diff --git a/build/owncloud/rainloop-app/lib/RainLoopHelper.php b/build/owncloud/rainloop-app/lib/RainLoopHelper.php index fe9617c05..cc67e8c3d 100644 --- a/build/owncloud/rainloop-app/lib/RainLoopHelper.php +++ b/build/owncloud/rainloop-app/lib/RainLoopHelper.php @@ -49,7 +49,7 @@ class OC_RainLoop_Helper if (function_exists('mcrypt_encrypt') && function_exists('mcrypt_create_iv') && function_exists('mcrypt_get_iv_size') && defined('MCRYPT_RIJNDAEL_256') && defined('MCRYPT_MODE_ECB') && defined('MCRYPT_RAND')) { - return @trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($sSalt), $sPassword, + return @trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($sSalt), base64_encode($sPassword), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)))); } @@ -61,8 +61,8 @@ class OC_RainLoop_Helper if (function_exists('mcrypt_encrypt') && function_exists('mcrypt_create_iv') && function_exists('mcrypt_get_iv_size') && defined('MCRYPT_RIJNDAEL_256') && defined('MCRYPT_MODE_ECB') && defined('MCRYPT_RAND')) { - return @mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($sSalt), base64_decode(trim($sPassword)), - MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)); + return @base64_decode(trim(@mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($sSalt), base64_decode(trim($sPassword)), + MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)))); } return @base64_decode(trim($sPassword)); diff --git a/dev/Admin.js b/dev/Admin.js deleted file mode 100644 index 55c200bc6..000000000 --- a/dev/Admin.js +++ /dev/null @@ -1,4 +0,0 @@ -(function (require) { - 'use strict'; - require('App:Boot')(require('App:Admin')); -}(require)); \ No newline at end of file diff --git a/dev/Apps/AbstractApp.js b/dev/App/Abstract.js similarity index 95% rename from dev/Apps/AbstractApp.js rename to dev/App/Abstract.js index 8525e9886..b53785a64 100644 --- a/dev/Apps/AbstractApp.js +++ b/dev/App/Abstract.js @@ -13,19 +13,19 @@ LinkBuilder = require('Common/LinkBuilder'), Events = require('Common/Events'), - Settings = require('Storage:Settings'), + Settings = require('Storage/Settings'), - KnoinAbstractBoot = require('Knoin:AbstractBoot') + AbstractBoot = require('Knoin/AbstractBoot') ; /** * @constructor * @param {RemoteStorage|AdminRemoteStorage} Remote - * @extends KnoinAbstractBoot + * @extends AbstractBoot */ function AbstractApp(Remote) { - KnoinAbstractBoot.call(this); + AbstractBoot.call(this); this.isLocalAutocomplete = true; @@ -62,7 +62,7 @@ }); } - _.extend(AbstractApp.prototype, KnoinAbstractBoot.prototype); + _.extend(AbstractApp.prototype, AbstractBoot.prototype); AbstractApp.prototype.remote = function () { @@ -136,7 +136,7 @@ AbstractApp.prototype.loginAndLogoutReload = function (bLogout, bClose) { var - kn = require('App:Knoin'), + kn = require('Knoin/Knoin'), sCustomLogoutLink = Utils.pString(Settings.settingsGet('CustomLogoutLink')), bInIframe = !!Settings.settingsGet('InIframe') ; diff --git a/dev/Apps/AdminApp.js b/dev/App/Admin.js similarity index 93% rename from dev/Apps/AdminApp.js rename to dev/App/Admin.js index cab11dce3..1c3ca7354 100644 --- a/dev/Apps/AdminApp.js +++ b/dev/App/Admin.js @@ -12,15 +12,12 @@ Utils = require('Common/Utils'), LinkBuilder = require('Common/LinkBuilder'), - Settings = require('Storage:Settings'), - Data = require('Storage:Admin:Data'), - Remote = require('Storage:Admin:Remote'), + Settings = require('Storage/Settings'), + Data = require('Storage/Admin/Data'), + Remote = require('Storage/Admin/Remote'), - AdminSettingsScreen = require('Screen:Admin:Settings'), - AdminLoginScreen = require('Screen:Admin:Login'), - - kn = require('App:Knoin'), - AbstractApp = require('App:Abstract') + kn = require('Knoin/Knoin'), + AbstractApp = require('App/Abstract') ; /** @@ -254,11 +251,15 @@ { if (!!Settings.settingsGet('Auth')) { - kn.startScreens([AdminSettingsScreen]); + kn.startScreens([ + require('Screen/Admin/Settings') + ]); } else { - kn.startScreens([AdminLoginScreen]); + kn.startScreens([ + require('Screen/Admin/Login') + ]); } } diff --git a/dev/Apps/RainLoopApp.js b/dev/App/App.js similarity index 83% rename from dev/Apps/RainLoopApp.js rename to dev/App/App.js index 8aa5d60db..fcbb45587 100644 --- a/dev/Apps/RainLoopApp.js +++ b/dev/App/App.js @@ -17,13 +17,13 @@ LinkBuilder = require('Common/LinkBuilder'), Events = require('Common/Events'), - kn = require('App:Knoin'), + kn = require('Knoin/Knoin'), - Local = require('Storage:LocalStorage'), - Settings = require('Storage:Settings'), - Data = require('Storage:RainLoop:Data'), - Cache = require('Storage:RainLoop:Cache'), - Remote = require('Storage:RainLoop:Remote'), + Local = require('Storage/Local'), + Settings = require('Storage/Settings'), + Data = require('Storage/App/Data'), + Cache = require('Storage/App/Cache'), + Remote = require('Storage/App/Remote'), EmailModel = require('Model/Email'), FolderModel = require('Model/Folder'), @@ -32,14 +32,14 @@ IdentityModel = require('Model/Identity'), OpenPgpKeyModel = require('Model/OpenPgpKey'), - AbstractApp = require('App:Abstract') + AbstractApp = require('App/Abstract') ; /** * @constructor * @extends AbstractApp */ - function RainLoopApp() + function AppApp() { AbstractApp.call(this, Remote); @@ -102,19 +102,19 @@ this.socialUsers = _.bind(this.socialUsers, this); } - _.extend(RainLoopApp.prototype, AbstractApp.prototype); + _.extend(AppApp.prototype, AbstractApp.prototype); - RainLoopApp.prototype.remote = function () + AppApp.prototype.remote = function () { return Remote; }; - RainLoopApp.prototype.data = function () + AppApp.prototype.data = function () { return Data; }; - RainLoopApp.prototype.reloadFlagsCurrentMessageListAndMessageFromCache = function () + AppApp.prototype.reloadFlagsCurrentMessageListAndMessageFromCache = function () { _.each(Data.messageList(), function (oMessage) { Cache.initMessageFlagsFromCache(oMessage); @@ -127,7 +127,7 @@ * @param {boolean=} bDropPagePosition = false * @param {boolean=} bDropCurrenFolderCache = false */ - RainLoopApp.prototype.reloadMessageList = function (bDropPagePosition, bDropCurrenFolderCache) + AppApp.prototype.reloadMessageList = function (bDropPagePosition, bDropCurrenFolderCache) { var self = this, @@ -171,12 +171,12 @@ }, Data.currentFolderFullNameRaw(), iOffset, Data.messagesPerPage(), Data.messageListSearch()); }; - RainLoopApp.prototype.recacheInboxMessageList = function () + AppApp.prototype.recacheInboxMessageList = function () { Remote.messageList(Utils.emptyFunction, 'INBOX', 0, Data.messagesPerPage(), '', true); }; - RainLoopApp.prototype.reloadMessageListHelper = function (bEmptyList) + AppApp.prototype.reloadMessageListHelper = function (bEmptyList) { this.reloadMessageList(bEmptyList); }; @@ -185,7 +185,7 @@ * @param {Function} fResultFunc * @returns {boolean} */ - RainLoopApp.prototype.contactsSync = function (fResultFunc) + AppApp.prototype.contactsSync = function (fResultFunc) { var oContacts = Data.contacts; if (oContacts.importing() || oContacts.syncing() || !Data.enableContactsSync() || !Data.allowContactsSync()) @@ -208,7 +208,7 @@ return true; }; - RainLoopApp.prototype.messagesMoveTrigger = function () + AppApp.prototype.messagesMoveTrigger = function () { var self = this, @@ -229,7 +229,7 @@ this.oMoveCache = {}; }; - RainLoopApp.prototype.messagesMoveHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForMove) + AppApp.prototype.messagesMoveHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForMove) { var sH = '$$' + sFromFolderFullNameRaw + '$$' + sToFolderFullNameRaw + '$$'; if (!this.oMoveCache[sH]) @@ -245,7 +245,7 @@ this.messagesMoveTrigger(); }; - RainLoopApp.prototype.messagesCopyHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForCopy) + AppApp.prototype.messagesCopyHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForCopy) { Remote.messagesCopy( this.moveOrDeleteResponseHelper, @@ -255,7 +255,7 @@ ); }; - RainLoopApp.prototype.messagesDeleteHelper = function (sFromFolderFullNameRaw, aUidForRemove) + AppApp.prototype.messagesDeleteHelper = function (sFromFolderFullNameRaw, aUidForRemove) { Remote.messagesDelete( this.moveOrDeleteResponseHelper, @@ -264,7 +264,7 @@ ); }; - RainLoopApp.prototype.moveOrDeleteResponseHelper = function (sResult, oData) + AppApp.prototype.moveOrDeleteResponseHelper = function (sResult, oData) { if (Enums.StorageResultType.Success === sResult && Data.currentFolder()) { @@ -292,7 +292,7 @@ * @param {string} sFromFolderFullNameRaw * @param {Array} aUidForRemove */ - RainLoopApp.prototype.deleteMessagesFromFolderWithoutCheck = function (sFromFolderFullNameRaw, aUidForRemove) + AppApp.prototype.deleteMessagesFromFolderWithoutCheck = function (sFromFolderFullNameRaw, aUidForRemove) { this.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove); Data.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove); @@ -304,7 +304,7 @@ * @param {Array} aUidForRemove * @param {boolean=} bUseFolder = true */ - RainLoopApp.prototype.deleteMessagesFromFolder = function (iDeleteType, sFromFolderFullNameRaw, aUidForRemove, bUseFolder) + AppApp.prototype.deleteMessagesFromFolder = function (iDeleteType, sFromFolderFullNameRaw, aUidForRemove, bUseFolder) { var self = this, @@ -344,12 +344,12 @@ if (!oMoveFolder && bUseFolder) { - kn.showScreenPopup(require('View:Popup:FolderSystem'), [nSetSystemFoldersNotification]); + kn.showScreenPopup(require('View/Popup/FolderSystem'), [nSetSystemFoldersNotification]); } else if (!bUseFolder || (Enums.FolderType.Trash === iDeleteType && (sFromFolderFullNameRaw === Data.spamFolder() || sFromFolderFullNameRaw === Data.trashFolder()))) { - kn.showScreenPopup(require('View:Popup:Ask'), [Utils.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () { + kn.showScreenPopup(require('View/Popup/Ask'), [Utils.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () { self.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove); Data.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove); @@ -369,7 +369,7 @@ * @param {string} sToFolderFullNameRaw * @param {boolean=} bCopy = false */ - RainLoopApp.prototype.moveMessagesToFolder = function (sFromFolderFullNameRaw, aUidForMove, sToFolderFullNameRaw, bCopy) + AppApp.prototype.moveMessagesToFolder = function (sFromFolderFullNameRaw, aUidForMove, sToFolderFullNameRaw, bCopy) { if (sFromFolderFullNameRaw !== sToFolderFullNameRaw && Utils.isArray(aUidForMove) && 0 < aUidForMove.length) { @@ -400,7 +400,7 @@ /** * @param {Function=} fCallback */ - RainLoopApp.prototype.folders = function (fCallback) + AppApp.prototype.folders = function (fCallback) { Data.foldersLoading(true); Remote.folders(_.bind(function (sResult, oData) { @@ -424,7 +424,7 @@ }, this)); }; - RainLoopApp.prototype.reloadOpenPgpKeys = function () + AppApp.prototype.reloadOpenPgpKeys = function () { if (Data.capaOpenPGP()) { @@ -467,7 +467,7 @@ } }; - RainLoopApp.prototype.accountsAndIdentities = function () + AppApp.prototype.accountsAndIdentities = function () { Data.accountsLoading(true); Data.identitiesLoading(true); @@ -514,7 +514,7 @@ }); }; - RainLoopApp.prototype.quota = function () + AppApp.prototype.quota = function () { Remote.quota(function (sResult, oData) { if (Enums.StorageResultType.Success === sResult && oData && oData.Result && @@ -531,7 +531,7 @@ * @param {string} sFolder * @param {Array=} aList = [] */ - RainLoopApp.prototype.folderInformation = function (sFolder, aList) + AppApp.prototype.folderInformation = function (sFolder, aList) { if ('' !== Utils.trim(sFolder)) { @@ -635,7 +635,7 @@ /** * @param {boolean=} bBoot = false */ - RainLoopApp.prototype.folderInformationMultiply = function (bBoot) + AppApp.prototype.folderInformationMultiply = function (bBoot) { bBoot = Utils.isUnd(bBoot) ? false : !!bBoot; @@ -721,7 +721,7 @@ } }; - RainLoopApp.prototype.setMessageSeen = function (oMessage) + AppApp.prototype.setMessageSeen = function (oMessage) { if (oMessage.unseen()) { @@ -741,17 +741,17 @@ Remote.messageSetSeen(Utils.emptyFunction, oMessage.folderFullNameRaw, [oMessage.uid], true); }; - RainLoopApp.prototype.googleConnect = function () + AppApp.prototype.googleConnect = function () { window.open(LinkBuilder.socialGoogle(), 'Google', 'left=200,top=100,width=650,height=600,menubar=no,status=no,resizable=yes,scrollbars=yes'); }; - RainLoopApp.prototype.twitterConnect = function () + AppApp.prototype.twitterConnect = function () { window.open(LinkBuilder.socialTwitter(), 'Twitter', 'left=200,top=100,width=650,height=350,menubar=no,status=no,resizable=yes,scrollbars=yes'); }; - RainLoopApp.prototype.facebookConnect = function () + AppApp.prototype.facebookConnect = function () { window.open(LinkBuilder.socialFacebook(), 'Facebook', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes'); }; @@ -759,7 +759,7 @@ /** * @param {boolean=} bFireAllActions */ - RainLoopApp.prototype.socialUsers = function (bFireAllActions) + AppApp.prototype.socialUsers = function (bFireAllActions) { if (bFireAllActions) { @@ -793,19 +793,19 @@ }); }; - RainLoopApp.prototype.googleDisconnect = function () + AppApp.prototype.googleDisconnect = function () { Data.googleActions(true); Remote.googleDisconnect(this.socialUsers); }; - RainLoopApp.prototype.facebookDisconnect = function () + AppApp.prototype.facebookDisconnect = function () { Data.facebookActions(true); Remote.facebookDisconnect(this.socialUsers); }; - RainLoopApp.prototype.twitterDisconnect = function () + AppApp.prototype.twitterDisconnect = function () { Data.twitterActions(true); Remote.twitterDisconnect(this.socialUsers); @@ -815,7 +815,7 @@ * @param {string} sQuery * @param {Function} fCallback */ - RainLoopApp.prototype.getAutocomplete = function (sQuery, fCallback) + AppApp.prototype.getAutocomplete = function (sQuery, fCallback) { var aData = [] @@ -842,14 +842,14 @@ * @param {string} sQuery * @param {Function} fCallback */ - RainLoopApp.prototype.getContactTagsAutocomplete = function (sQuery, fCallback) + AppApp.prototype.getContactTagsAutocomplete = function (sQuery, fCallback) { fCallback(_.filter(Data.contactTags(), function (oContactTag) { return oContactTag && oContactTag.filterHelper(sQuery); })); }; - RainLoopApp.prototype.setMessageList = function (oData, bCached) + AppApp.prototype.setMessageList = function (oData, bCached) { if (oData && oData.Result && 'Collection/MessageCollection' === oData.Result['@Object'] && oData.Result['@Collection'] && Utils.isArray(oData.Result['@Collection'])) @@ -984,7 +984,7 @@ * @param {Array} aFolders * @return {Array} */ - RainLoopApp.prototype.folderResponseParseRec = function (sNamespace, aFolders) + AppApp.prototype.folderResponseParseRec = function (sNamespace, aFolders) { var self = this, @@ -1056,7 +1056,7 @@ /** * @param {*} oData */ - RainLoopApp.prototype.setFolders = function (oData) + AppApp.prototype.setFolders = function (oData) { var aList = [], @@ -1121,7 +1121,7 @@ * @param {string} sFullNameHash * @return {boolean} */ - RainLoopApp.prototype.isFolderExpanded = function (sFullNameHash) + AppApp.prototype.isFolderExpanded = function (sFullNameHash) { var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders); return Utils.isArray(aExpandedList) && -1 !== _.indexOf(aExpandedList, sFullNameHash); @@ -1131,7 +1131,7 @@ * @param {string} sFullNameHash * @param {boolean} bExpanded */ - RainLoopApp.prototype.setExpandedFolder = function (sFullNameHash, bExpanded) + AppApp.prototype.setExpandedFolder = function (sFullNameHash, bExpanded) { var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders); if (!Utils.isArray(aExpandedList)) @@ -1152,7 +1152,7 @@ Local.set(Enums.ClientSideKeyName.ExpandedFolders, aExpandedList); }; - RainLoopApp.prototype.initLayoutResizer = function (sLeft, sRight, sClientSideKeyName) + AppApp.prototype.initLayoutResizer = function (sLeft, sRight, sClientSideKeyName) { var iDisabledWidth = 60, @@ -1223,7 +1223,7 @@ }); }; - RainLoopApp.prototype.bootstartLoginScreen = function () + AppApp.prototype.bootstartLoginScreen = function () { var sCustomLoginLink = Utils.pString(Settings.settingsGet('CustomLoginLink')); if (!sCustomLoginLink) @@ -1231,7 +1231,7 @@ kn.hideLoading(); kn.startScreens([ - require('Screen:RainLoop:Login') + require('Screen/App/Login') ]); Plugins.runHook('rl-start-login-screens'); @@ -1249,7 +1249,7 @@ } }; - RainLoopApp.prototype.bootstart = function () + AppApp.prototype.bootstart = function () { AbstractApp.prototype.bootstart.call(this); @@ -1298,123 +1298,119 @@ { this.setTitle(Utils.i18n('TITLES/LOADING')); - require.ensure([], function () { + self.folders(_.bind(function (bValue) { - self.folders(_.bind(function (bValue) { + kn.hideLoading(); - kn.hideLoading(); - - if (bValue) + if (bValue) + { + if (window.$LAB && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP)) { - if (window.$LAB && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP)) - { - window.$LAB.script(window.openpgp ? '' : LinkBuilder.openPgpJs()).wait(function () { - if (window.openpgp) - { - Data.openpgp = window.openpgp; - Data.openpgpKeyring = new window.openpgp.Keyring(); - Data.capaOpenPGP(true); - - Events.pub('openpgp.init'); - - self.reloadOpenPgpKeys(); - } - }); - } - else - { - Data.capaOpenPGP(false); - } - - kn.startScreens([ - require('Screen:RainLoop:MailBox'), - require('Screen:RainLoop:Settings'), - require('Screen:RainLoop:About') - ]); - - if (bGoogle || bFacebook || bTwitter) - { - self.socialUsers(true); - } - - Events.sub('interval.2m', function () { - self.folderInformation('INBOX'); - }); - - Events.sub('interval.2m', function () { - var sF = Data.currentFolderFullNameRaw(); - if ('INBOX' !== sF) + window.$LAB.script(window.openpgp ? '' : LinkBuilder.openPgpJs()).wait(function () { + if (window.openpgp) { - self.folderInformation(sF); + Data.openpgp = window.openpgp; + Data.openpgpKeyring = new window.openpgp.Keyring(); + Data.capaOpenPGP(true); + + Events.pub('openpgp.init'); + + self.reloadOpenPgpKeys(); } }); - - Events.sub('interval.3m', function () { - self.folderInformationMultiply(); - }); - - Events.sub('interval.5m', function () { - self.quota(); - }); - - Events.sub('interval.10m', function () { - self.folders(); - }); - - iContactsSyncInterval = 5 <= iContactsSyncInterval ? iContactsSyncInterval : 20; - iContactsSyncInterval = 320 >= iContactsSyncInterval ? iContactsSyncInterval : 320; - - window.setInterval(function () { - self.contactsSync(); - }, iContactsSyncInterval * 60000 + 5000); - - _.delay(function () { - self.contactsSync(); - }, 5000); - - _.delay(function () { - self.folderInformationMultiply(true); - }, 500); - - Plugins.runHook('rl-start-user-screens'); - Events.pub('rl.bootstart-user-screens'); - - if (!!Settings.settingsGet('AccountSignMe') && window.navigator.registerProtocolHandler) - { - _.delay(function () { - try { - window.navigator.registerProtocolHandler('mailto', - window.location.protocol + '//' + window.location.host + window.location.pathname + '?mailto&to=%s', - '' + (Settings.settingsGet('Title') || 'RainLoop')); - } catch(e) {} - - if (Settings.settingsGet('MailToEmail')) - { - Utils.mailToHelper(Settings.settingsGet('MailToEmail'), require('View:Popup:Compose')); - } - }, 500); - } - - if (!Globals.bMobileDevice) - { - _.defer(function () { - self.initLayoutResizer('#rl-left', '#rl-right', Enums.ClientSideKeyName.FolderListSize); - }); - } } else { - self.bootstartLoginScreen(); + Data.capaOpenPGP(false); } - if (window.SimplePace) + kn.startScreens([ + require('Screen/App/MailBox'), + require('Screen/App/Settings'), + require('Screen/App/About') + ]); + + if (bGoogle || bFacebook || bTwitter) { - window.SimplePace.set(100); + self.socialUsers(true); } - }, self)); - - }); + Events.sub('interval.2m', function () { + self.folderInformation('INBOX'); + }); + + Events.sub('interval.2m', function () { + var sF = Data.currentFolderFullNameRaw(); + if ('INBOX' !== sF) + { + self.folderInformation(sF); + } + }); + + Events.sub('interval.3m', function () { + self.folderInformationMultiply(); + }); + + Events.sub('interval.5m', function () { + self.quota(); + }); + + Events.sub('interval.10m', function () { + self.folders(); + }); + + iContactsSyncInterval = 5 <= iContactsSyncInterval ? iContactsSyncInterval : 20; + iContactsSyncInterval = 320 >= iContactsSyncInterval ? iContactsSyncInterval : 320; + + window.setInterval(function () { + self.contactsSync(); + }, iContactsSyncInterval * 60000 + 5000); + + _.delay(function () { + self.contactsSync(); + }, 5000); + + _.delay(function () { + self.folderInformationMultiply(true); + }, 500); + + Plugins.runHook('rl-start-user-screens'); + Events.pub('rl.bootstart-user-screens'); + + if (!!Settings.settingsGet('AccountSignMe') && window.navigator.registerProtocolHandler) + { + _.delay(function () { + try { + window.navigator.registerProtocolHandler('mailto', + window.location.protocol + '//' + window.location.host + window.location.pathname + '?mailto&to=%s', + '' + (Settings.settingsGet('Title') || 'RainLoop')); + } catch(e) {} + + if (Settings.settingsGet('MailToEmail')) + { + Utils.mailToHelper(Settings.settingsGet('MailToEmail'), require('View/Popup/Compose')); + } + }, 500); + } + + if (!Globals.bMobileDevice) + { + _.defer(function () { + self.initLayoutResizer('#rl-left', '#rl-right', Enums.ClientSideKeyName.FolderListSize); + }); + } + } + else + { + self.bootstartLoginScreen(); + } + + if (window.SimplePace) + { + window.SimplePace.set(100); + } + + }, self)); } else { @@ -1458,6 +1454,6 @@ Events.pub('rl.bootstart-end'); }; - module.exports = new RainLoopApp(); + module.exports = new AppApp(); }()); \ No newline at end of file diff --git a/dev/Boot.js b/dev/App/Boot.js similarity index 100% rename from dev/Boot.js rename to dev/App/Boot.js diff --git a/dev/Common/HtmlEditor.js b/dev/Common/HtmlEditor.js index b099bb6c7..c7a380088 100644 --- a/dev/Common/HtmlEditor.js +++ b/dev/Common/HtmlEditor.js @@ -8,7 +8,7 @@ _ = require('_'), Globals = require('Common/Globals'), - Settings = require('Storage:Settings') + Settings = require('Storage/Settings') ; /** @@ -78,6 +78,7 @@ }; /** + * @param {boolean=} bWrapIsHtml = false * @return {string} */ HtmlEditor.prototype.getData = function (bWrapIsHtml) diff --git a/dev/Common/LinkBuilder.js b/dev/Common/LinkBuilder.js index 428a660da..b49905454 100644 --- a/dev/Common/LinkBuilder.js +++ b/dev/Common/LinkBuilder.js @@ -12,7 +12,7 @@ */ function LinkBuilder() { - var Settings = require('Storage:Settings'); + var Settings = require('Storage/Settings'); this.sBase = '#/'; this.sServer = './?'; diff --git a/dev/Common/Plugins.js b/dev/Common/Plugins.js index c25564796..fbb9f34bf 100644 --- a/dev/Common/Plugins.js +++ b/dev/Common/Plugins.js @@ -15,7 +15,7 @@ */ function Plugins() { - this.oSettings = require('Storage:Settings'); + this.oSettings = require('Storage/Settings'); this.oViewModelsHooks = {}; this.oSimpleHooks = {}; } diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js index 660d5c0de..1caf7779c 100644 --- a/dev/Common/Utils.js +++ b/dev/Common/Utils.js @@ -157,7 +157,7 @@ { oParams = Utils.simpleQueryParser(sQueryString); - require('App:Knoin').showScreenPopup(PopupComposeVoreModel, [Enums.ComposeType.Empty, null, [oEmailModel], + require('Knoin/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)) ]); diff --git a/dev/Knoin/AbstractBoot.js b/dev/Knoin/AbstractBoot.js new file mode 100644 index 000000000..7f4f793c9 --- /dev/null +++ b/dev/Knoin/AbstractBoot.js @@ -0,0 +1,21 @@ + +(function () { + + 'use strict'; + + /** + * @constructor + */ + function AbstractBoot() + { + + } + + AbstractBoot.prototype.bootstart = function () + { + + }; + + module.exports = AbstractBoot; + +}()); \ No newline at end of file diff --git a/dev/Knoin/KnoinAbstractScreen.js b/dev/Knoin/AbstractScreen.js similarity index 66% rename from dev/Knoin/KnoinAbstractScreen.js rename to dev/Knoin/AbstractScreen.js index f4e6ef515..89d2493b9 100644 --- a/dev/Knoin/KnoinAbstractScreen.js +++ b/dev/Knoin/AbstractScreen.js @@ -15,7 +15,7 @@ * @param {?=} aViewModels = [] * @constructor */ - function KnoinAbstractScreen(sScreenName, aViewModels) + function AbstractScreen(sScreenName, aViewModels) { this.sScreenName = sScreenName; this.aViewModels = Utils.isArray(aViewModels) ? aViewModels : []; @@ -24,22 +24,22 @@ /** * @type {Array} */ - KnoinAbstractScreen.prototype.oCross = null; + AbstractScreen.prototype.oCross = null; /** * @type {string} */ - KnoinAbstractScreen.prototype.sScreenName = ''; + AbstractScreen.prototype.sScreenName = ''; /** * @type {Array} */ - KnoinAbstractScreen.prototype.aViewModels = []; + AbstractScreen.prototype.aViewModels = []; /** * @return {Array} */ - KnoinAbstractScreen.prototype.viewModels = function () + AbstractScreen.prototype.viewModels = function () { return this.aViewModels; }; @@ -47,12 +47,12 @@ /** * @return {string} */ - KnoinAbstractScreen.prototype.screenName = function () + AbstractScreen.prototype.screenName = function () { return this.sScreenName; }; - KnoinAbstractScreen.prototype.routes = function () + AbstractScreen.prototype.routes = function () { return null; }; @@ -60,12 +60,12 @@ /** * @return {?Object} */ - KnoinAbstractScreen.prototype.__cross = function () + AbstractScreen.prototype.__cross = function () { return this.oCross; }; - KnoinAbstractScreen.prototype.__start = function () + AbstractScreen.prototype.__start = function () { var aRoutes = this.routes(), @@ -86,6 +86,6 @@ } }; - module.exports = KnoinAbstractScreen; + module.exports = AbstractScreen; }()); \ No newline at end of file diff --git a/dev/Knoin/KnoinAbstractViewModel.js b/dev/Knoin/AbstractView.js similarity index 61% rename from dev/Knoin/KnoinAbstractViewModel.js rename to dev/Knoin/AbstractView.js index e06e4ca23..e5e2e7127 100644 --- a/dev/Knoin/KnoinAbstractViewModel.js +++ b/dev/Knoin/AbstractView.js @@ -16,7 +16,7 @@ * @param {string=} sPosition = '' * @param {string=} sTemplate = '' */ - function KnoinAbstractViewModel(sPosition, sTemplate) + function AbstractView(sPosition, sTemplate) { this.bDisabeCloseOnEsc = false; this.sPosition = Utils.pString(sPosition); @@ -36,47 +36,47 @@ /** * @type {boolean} */ - KnoinAbstractViewModel.prototype.bDisabeCloseOnEsc = false; + AbstractView.prototype.bDisabeCloseOnEsc = false; /** * @type {string} */ - KnoinAbstractViewModel.prototype.sPosition = ''; + AbstractView.prototype.sPosition = ''; /** * @type {string} */ - KnoinAbstractViewModel.prototype.sTemplate = ''; + AbstractView.prototype.sTemplate = ''; /** * @type {string} */ - KnoinAbstractViewModel.prototype.sDefaultKeyScope = Enums.KeyState.None; + AbstractView.prototype.sDefaultKeyScope = Enums.KeyState.None; /** * @type {string} */ - KnoinAbstractViewModel.prototype.sCurrentKeyScope = Enums.KeyState.None; + AbstractView.prototype.sCurrentKeyScope = Enums.KeyState.None; /** * @type {string} */ - KnoinAbstractViewModel.prototype.viewModelName = ''; + AbstractView.prototype.viewModelName = ''; /** * @type {Array} */ - KnoinAbstractViewModel.prototype.viewModelNames = []; + AbstractView.prototype.viewModelNames = []; /** * @type {?} */ - KnoinAbstractViewModel.prototype.viewModelDom = null; + AbstractView.prototype.viewModelDom = null; /** * @return {string} */ - KnoinAbstractViewModel.prototype.viewModelTemplate = function () + AbstractView.prototype.viewModelTemplate = function () { return this.sTemplate; }; @@ -84,26 +84,26 @@ /** * @return {string} */ - KnoinAbstractViewModel.prototype.viewModelPosition = function () + AbstractView.prototype.viewModelPosition = function () { return this.sPosition; }; - KnoinAbstractViewModel.prototype.cancelCommand = function () {}; - KnoinAbstractViewModel.prototype.closeCommand = function () {}; + AbstractView.prototype.cancelCommand = function () {}; + AbstractView.prototype.closeCommand = function () {}; - KnoinAbstractViewModel.prototype.storeAndSetKeyScope = function () + AbstractView.prototype.storeAndSetKeyScope = function () { this.sCurrentKeyScope = Globals.keyScope(); Globals.keyScope(this.sDefaultKeyScope); }; - KnoinAbstractViewModel.prototype.restoreKeyScope = function () + AbstractView.prototype.restoreKeyScope = function () { Globals.keyScope(this.sCurrentKeyScope); }; - KnoinAbstractViewModel.prototype.registerPopupKeyDown = function () + AbstractView.prototype.registerPopupKeyDown = function () { var self = this; @@ -125,6 +125,6 @@ }); }; - module.exports = KnoinAbstractViewModel; + module.exports = AbstractView; }()); \ No newline at end of file diff --git a/dev/Knoin/KnoinAbstractBoot.js b/dev/Knoin/KnoinAbstractBoot.js deleted file mode 100644 index cda1e7ef1..000000000 --- a/dev/Knoin/KnoinAbstractBoot.js +++ /dev/null @@ -1,21 +0,0 @@ - -(function () { - - 'use strict'; - - /** - * @constructor - */ - function KnoinAbstractBoot() - { - - } - - KnoinAbstractBoot.prototype.bootstart = function () - { - - }; - - module.exports = KnoinAbstractBoot; - -}()); \ No newline at end of file diff --git a/dev/Model/Message.js b/dev/Model/Message.js index 718db9f50..7a44ae66f 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -353,7 +353,7 @@ MessageModel.prototype.computeSenderEmail = function () { var - Data = require('Storage:RainLoop:Data'), + Data = require('Storage/App/Data'), sSent = Data.sentFolder(), sDraft = Data.draftFolder() ; @@ -432,7 +432,7 @@ { var bResult = false, - Data = require('Storage:RainLoop:Data'), + Data = require('Storage/App/Data'), iPriority = Enums.MessagePriority.Normal ; @@ -1088,7 +1088,7 @@ this.body.data('rl-plain-raw', this.plainRaw); - var Data = require('Storage:RainLoop:Data'); + var Data = require('Storage/App/Data'); if (Data.capaOpenPGP()) { this.body.data('rl-plain-pgp-signed', !!this.isPgpSigned()); @@ -1101,7 +1101,7 @@ MessageModel.prototype.storePgpVerifyDataToDom = function () { - var Data = require('Storage:RainLoop:Data'); + var Data = require('Storage/App/Data'); if (this.body && Data.capaOpenPGP()) { this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus()); @@ -1118,7 +1118,7 @@ this.plainRaw = Utils.pString(this.body.data('rl-plain-raw')); - var Data = require('Storage:RainLoop:Data'); + var Data = require('Storage/App/Data'); if (Data.capaOpenPGP()) { this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed')); @@ -1143,7 +1143,7 @@ var aRes = [], mPgpMessage = null, - Data = require('Storage:RainLoop:Data'), + Data = require('Storage/App/Data'), sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '', aPublicKeys = Data.findPublicKeysByEmail(sFrom), oValidKey = null, @@ -1207,7 +1207,7 @@ aRes = [], mPgpMessage = null, mPgpMessageDecrypted = null, - Data = require('Storage:RainLoop:Data'), + Data = require('Storage/App/Data'), sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '', aPublicKey = Data.findPublicKeysByEmail(sFrom), oPrivateKey = Data.findSelfPrivateKey(sPassword), diff --git a/dev/RainLoop.js b/dev/RainLoop.js deleted file mode 100644 index e8488bc6d..000000000 --- a/dev/RainLoop.js +++ /dev/null @@ -1,4 +0,0 @@ -(function (require) { - 'use strict'; - require('App:Boot')(require('App:RainLoop')); -}(require)); \ No newline at end of file diff --git a/dev/Screens/AbstractSettingsScreen.js b/dev/Screen/AbstractSettings.js similarity index 95% rename from dev/Screens/AbstractSettingsScreen.js rename to dev/Screen/AbstractSettings.js index ee99b7af7..e4d62572e 100644 --- a/dev/Screens/AbstractSettingsScreen.js +++ b/dev/Screen/AbstractSettings.js @@ -12,18 +12,18 @@ Utils = require('Common/Utils'), LinkBuilder = require('Common/LinkBuilder'), - kn = require('App:Knoin'), - KnoinAbstractScreen = require('Knoin:AbstractScreen') + kn = require('Knoin/Knoin'), + AbstractScreen = require('Knoin/AbstractScreen') ; /** * @constructor * @param {Array} aViewModels - * @extends KnoinAbstractScreen + * @extends AbstractScreen */ function AbstractSettingsScreen(aViewModels) { - KnoinAbstractScreen.call(this, 'settings', aViewModels); + AbstractScreen.call(this, 'settings', aViewModels); this.menu = ko.observableArray([]); @@ -33,7 +33,7 @@ this.setupSettings(); } - _.extend(AbstractSettingsScreen.prototype, KnoinAbstractScreen.prototype); + _.extend(AbstractSettingsScreen.prototype, AbstractScreen.prototype); /** * @param {Function=} fCallback diff --git a/dev/Screen/Admin/Login.js b/dev/Screen/Admin/Login.js new file mode 100644 index 000000000..9dd723aef --- /dev/null +++ b/dev/Screen/Admin/Login.js @@ -0,0 +1,32 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + + AbstractScreen = require('Knoin/AbstractScreen') + ; + + /** + * @constructor + * @extends AbstractScreen + */ + function LoginAdminScreen() + { + AbstractScreen.call(this, 'login', [ + require('View/Admin/Login') + ]); + } + + _.extend(LoginAdminScreen.prototype, AbstractScreen.prototype); + + LoginAdminScreen.prototype.onShow = function () + { + require('App/Admin').setTitle(''); + }; + + module.exports = LoginAdminScreen; + +}()); \ No newline at end of file diff --git a/dev/Screen/Admin/Settings.js b/dev/Screen/Admin/Settings.js new file mode 100644 index 000000000..3b76641e7 --- /dev/null +++ b/dev/Screen/Admin/Settings.js @@ -0,0 +1,79 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + + kn = require('Knoin/Knoin'), + + AbstractSettings = require('Screen/AbstractSettings') + ; + + /** + * @constructor + * @extends AbstractSettings + */ + function SettingsAdminScreen() + { + AbstractSettings.call(this, [ + require('View/Admin/Settings/Menu'), + require('View/Admin/Settings/Pane') + ]); + } + + _.extend(SettingsAdminScreen.prototype, AbstractSettings.prototype); + + /** + * @param {Function=} fCallback + */ + SettingsAdminScreen.prototype.setupSettings = function (fCallback) + { + kn.addSettingsViewModel(require('Settings/Admin/General'), + 'AdminSettingsGeneral', 'General', 'general', true); + + kn.addSettingsViewModel(require('Settings/Admin/Login'), + 'AdminSettingsLogin', 'Login', 'login'); + + kn.addSettingsViewModel(require('Settings/Admin/Branding'), + 'AdminSettingsBranding', 'Branding', 'branding'); + + kn.addSettingsViewModel(require('Settings/Admin/Contacts'), + 'AdminSettingsContacts', 'Contacts', 'contacts'); + + kn.addSettingsViewModel(require('Settings/Admin/Domains'), + 'AdminSettingsDomains', 'Domains', 'domains'); + + kn.addSettingsViewModel(require('Settings/Admin/Security'), + 'AdminSettingsSecurity', 'Security', 'security'); + + kn.addSettingsViewModel(require('Settings/Admin/Social'), + 'AdminSettingsSocial', 'Social', 'social'); + + kn.addSettingsViewModel(require('Settings/Admin/Plugins'), + 'AdminSettingsPlugins', 'Plugins', 'plugins'); + + kn.addSettingsViewModel(require('Settings/Admin/Packages'), + 'AdminSettingsPackages', 'Packages', 'packages'); + + kn.addSettingsViewModel(require('Settings/Admin/Licensing'), + 'AdminSettingsLicensing', 'Licensing', 'licensing'); + + kn.addSettingsViewModel(require('Settings/Admin/About'), + 'AdminSettingsAbout', 'About', 'about'); + + if (fCallback) + { + fCallback(); + } + }; + + SettingsAdminScreen.prototype.onShow = function () + { + require('App/Admin').setTitle(''); + }; + + module.exports = SettingsAdminScreen; + +}()); \ No newline at end of file diff --git a/dev/Screen/App/About.js b/dev/Screen/App/About.js new file mode 100644 index 000000000..18accf34a --- /dev/null +++ b/dev/Screen/App/About.js @@ -0,0 +1,32 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + + AbstractScreen = require('Knoin/AbstractScreen') + ; + + /** + * @constructor + * @extends AbstractScreen + */ + function AboutAppScreen() + { + AbstractScreen.call(this, 'about', [ + require('View/App/About') + ]); + } + + _.extend(AboutAppScreen.prototype, AbstractScreen.prototype); + + AboutAppScreen.prototype.onShow = function () + { + require('App/App').setTitle('RainLoop'); + }; + + module.exports = AboutAppScreen; + +}()); \ No newline at end of file diff --git a/dev/Screen/App/Login.js b/dev/Screen/App/Login.js new file mode 100644 index 000000000..b578e43a0 --- /dev/null +++ b/dev/Screen/App/Login.js @@ -0,0 +1,32 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + + AbstractScreen = require('Knoin/AbstractScreen') + ; + + /** + * @constructor + * @extends AbstractScreen + */ + function LoginAppScreen() + { + AbstractScreen.call(this, 'login', [ + require('View/App/Login') + ]); + } + + _.extend(LoginAppScreen.prototype, AbstractScreen.prototype); + + LoginAppScreen.prototype.onShow = function () + { + require('App/App').setTitle(''); + }; + + module.exports = LoginAppScreen; + +}()); \ No newline at end of file diff --git a/dev/Screens/MailBoxScreen.js b/dev/Screen/App/MailBox.js similarity index 72% rename from dev/Screens/MailBoxScreen.js rename to dev/Screen/App/MailBox.js index 15bb8c041..94e125184 100644 --- a/dev/Screens/MailBoxScreen.js +++ b/dev/Screen/App/MailBox.js @@ -11,49 +11,49 @@ Utils = require('Common/Utils'), Events = require('Common/Events'), - KnoinAbstractScreen = require('Knoin:AbstractScreen'), + Settings = require('Storage/Settings'), + Data = require('Storage/App/Data'), + Cache = require('Storage/App/Cache'), + Remote = require('Storage/App/Remote'), - Settings = require('Storage:Settings'), - Data = require('Storage:RainLoop:Data'), - Cache = require('Storage:RainLoop:Cache'), - Remote = require('Storage:RainLoop:Remote') + AbstractScreen = require('Knoin/AbstractScreen') ; /** * @constructor - * @extends KnoinAbstractScreen + * @extends AbstractScreen */ - function MailBoxScreen() + function MailBoxAppScreen() { - KnoinAbstractScreen.call(this, 'mailbox', [ - require('View:RainLoop:MailBoxSystemDropDown'), - require('View:RainLoop:MailBoxFolderList'), - require('View:RainLoop:MailBoxMessageList'), - require('View:RainLoop:MailBoxMessageView') + AbstractScreen.call(this, 'mailbox', [ + require('View/App/MailBox/SystemDropDown'), + require('View/App/MailBox/FolderList'), + require('View/App/MailBox/MessageList'), + require('View/App/MailBox/MessageView') ]); this.oLastRoute = {}; } - _.extend(MailBoxScreen.prototype, KnoinAbstractScreen.prototype); + _.extend(MailBoxAppScreen.prototype, AbstractScreen.prototype); /** * @type {Object} */ - MailBoxScreen.prototype.oLastRoute = {}; + MailBoxAppScreen.prototype.oLastRoute = {}; - MailBoxScreen.prototype.setNewTitle = function () + MailBoxAppScreen.prototype.setNewTitle = function () { var sEmail = Data.accountEmail(), nFoldersInboxUnreadCount = Data.foldersInboxUnreadCount() ; - require('App:RainLoop').setTitle(('' === sEmail ? '' : + require('App/App').setTitle(('' === sEmail ? '' : (0 < nFoldersInboxUnreadCount ? '(' + nFoldersInboxUnreadCount + ') ' : ' ') + sEmail + ' - ') + Utils.i18n('TITLES/MAILBOX')); }; - MailBoxScreen.prototype.onShow = function () + MailBoxAppScreen.prototype.onShow = function () { this.setNewTitle(); Globals.keyScope(Enums.KeyState.MessageList); @@ -65,13 +65,13 @@ * @param {string} sSearch * @param {boolean=} bPreview = false */ - MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPreview) + MailBoxAppScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPreview) { if (Utils.isUnd(bPreview) ? false : !!bPreview) { if (Enums.Layout.NoPreview === Data.layout() && !Data.message()) { - require('App:RainLoop').historyBack(); + require('App/App').historyBack(); } } else @@ -94,12 +94,12 @@ Data.message(null); } - require('App:RainLoop').reloadMessageList(); + require('App/App').reloadMessageList(); } } }; - MailBoxScreen.prototype.onStart = function () + MailBoxAppScreen.prototype.onStart = function () { var fResizeFunction = function () { @@ -109,18 +109,18 @@ if (Settings.capa(Enums.Capa.AdditionalAccounts) || Settings.capa(Enums.Capa.AdditionalIdentities)) { - require('App:RainLoop').accountsAndIdentities(); + require('App/App').accountsAndIdentities(); } _.delay(function () { if ('INBOX' !== Data.currentFolderFullNameRaw()) { - require('App:RainLoop').folderInformation('INBOX'); + require('App/App').folderInformation('INBOX'); } }, 1000); _.delay(function () { - require('App:RainLoop').quota(); + require('App/App').quota(); }, 5000); _.delay(function () { @@ -149,7 +149,7 @@ /** * @return {Array} */ - MailBoxScreen.prototype.routes = function () + MailBoxAppScreen.prototype.routes = function () { var fNormP = function () { @@ -191,6 +191,6 @@ ]; }; - module.exports = MailBoxScreen; + module.exports = MailBoxAppScreen; }()); \ No newline at end of file diff --git a/dev/Screens/SettingsScreen.js b/dev/Screen/App/Settings.js similarity index 60% rename from dev/Screens/SettingsScreen.js rename to dev/Screen/App/Settings.js index 20dbec296..8392f0a60 100644 --- a/dev/Screens/SettingsScreen.js +++ b/dev/Screen/App/Settings.js @@ -10,23 +10,23 @@ Utils = require('Common/Utils'), Globals = require('Common/Globals'), - Settings = require('Storage:Settings'), + Settings = require('Storage/Settings'), - kn = require('App:Knoin'), + kn = require('Knoin/Knoin'), - AbstractSettingsScreen = require('Screen:AbstractSettings') + AbstractSettingsScreen = require('Screen/AbstractSettings') ; /** * @constructor * @extends AbstractSettingsScreen */ - function SettingsScreen() + function SettingsAppScreen() { AbstractSettingsScreen.call(this, [ - require('View:RainLoop:SettingsSystemDropDown'), - require('View:RainLoop:SettingsMenu'), - require('View:RainLoop:SettingsPane') + require('View/App/Settings/SystemDropDown'), + require('View/App/Settings/Menu'), + require('View/App/Settings/Pane') ]); Utils.initOnStartOrLangChange(function () { @@ -36,48 +36,48 @@ }); } - _.extend(SettingsScreen.prototype, AbstractSettingsScreen.prototype); + _.extend(SettingsAppScreen.prototype, AbstractSettingsScreen.prototype); /** * @param {Function=} fCallback */ - SettingsScreen.prototype.setupSettings = function (fCallback) + SettingsAppScreen.prototype.setupSettings = function (fCallback) { - kn.addSettingsViewModel(require('Settings:RainLoop:General'), + kn.addSettingsViewModel(require('Settings/App/General'), 'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true); if (Settings.settingsGet('ContactsIsAllowed')) { - kn.addSettingsViewModel(require('Settings:RainLoop:Contacts'), + kn.addSettingsViewModel(require('Settings/App/Contacts'), 'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts'); } if (Settings.capa(Enums.Capa.AdditionalAccounts)) { - kn.addSettingsViewModel(require('Settings:RainLoop:Accounts'), + kn.addSettingsViewModel(require('Settings/App/Accounts'), 'SettingsAccounts', 'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME', 'accounts'); } if (Settings.capa(Enums.Capa.AdditionalIdentities)) { - kn.addSettingsViewModel(require('Settings:RainLoop:Identities'), + kn.addSettingsViewModel(require('Settings/App/Identities'), 'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities'); } else { - kn.addSettingsViewModel(require('Settings:RainLoop:Identity'), + kn.addSettingsViewModel(require('Settings/App/Identity'), 'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity'); } if (Settings.capa(Enums.Capa.Filters)) { - kn.addSettingsViewModel(require('Settings:RainLoop:Filters'), + kn.addSettingsViewModel(require('Settings/App/Filters'), 'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters'); } if (Settings.capa(Enums.Capa.TwoFactor)) { - kn.addSettingsViewModel(require('Settings:RainLoop:Security'), + kn.addSettingsViewModel(require('Settings/App/Security'), 'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security'); } @@ -85,28 +85,28 @@ Settings.settingsGet('AllowFacebookSocial') || Settings.settingsGet('AllowTwitterSocial')) { - kn.addSettingsViewModel(require('Settings:RainLoop:Social'), + kn.addSettingsViewModel(require('Settings/App/Social'), 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social'); } if (Settings.settingsGet('ChangePasswordIsAllowed')) { - kn.addSettingsViewModel(require('Settings:RainLoop:ChangePassword'), + kn.addSettingsViewModel(require('Settings/App/ChangePassword'), 'SettingsChangePassword', 'SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME', 'change-password'); } - kn.addSettingsViewModel(require('Settings:RainLoop:Folders'), + kn.addSettingsViewModel(require('Settings/App/Folders'), 'SettingsFolders', 'SETTINGS_LABELS/LABEL_FOLDERS_NAME', 'folders'); if (Settings.capa(Enums.Capa.Themes)) { - kn.addSettingsViewModel(require('Settings:RainLoop:Themes'), + kn.addSettingsViewModel(require('Settings/App/Themes'), 'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes'); } if (Settings.capa(Enums.Capa.OpenPGP)) { - kn.addSettingsViewModel(require('Settings:RainLoop:OpenPGP'), + kn.addSettingsViewModel(require('Settings/App/OpenPGP'), 'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp'); } @@ -116,17 +116,17 @@ } }; - SettingsScreen.prototype.onShow = function () + SettingsAppScreen.prototype.onShow = function () { this.setSettingsTitle(); Globals.keyScope(Enums.KeyState.Settings); }; - SettingsScreen.prototype.setSettingsTitle = function () + SettingsAppScreen.prototype.setSettingsTitle = function () { - require('App:RainLoop').setTitle(this.sSettingsTitle); + require('App/App').setTitle(this.sSettingsTitle); }; - module.exports = SettingsScreen; + module.exports = SettingsAppScreen; }()); \ No newline at end of file diff --git a/dev/Screens/AboutScreen.js b/dev/Screens/AboutScreen.js deleted file mode 100644 index daa60d213..000000000 --- a/dev/Screens/AboutScreen.js +++ /dev/null @@ -1,32 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - - KnoinAbstractScreen = require('Knoin:AbstractScreen') - ; - - /** - * @constructor - * @extends KnoinAbstractScreen - */ - function AboutScreen() - { - KnoinAbstractScreen.call(this, 'about', [ - require('View:RainLoop:About') - ]); - } - - _.extend(AboutScreen.prototype, KnoinAbstractScreen.prototype); - - AboutScreen.prototype.onShow = function () - { - require('App:RainLoop').setTitle('RainLoop'); - }; - - module.exports = AboutScreen; - -}()); \ No newline at end of file diff --git a/dev/Screens/AdminLoginScreen.js b/dev/Screens/AdminLoginScreen.js deleted file mode 100644 index da90a2001..000000000 --- a/dev/Screens/AdminLoginScreen.js +++ /dev/null @@ -1,32 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - - KnoinAbstractScreen = require('Knoin:AbstractScreen') - ; - - /** - * @constructor - * @extends KnoinAbstractScreen - */ - function AdminLoginScreen() - { - KnoinAbstractScreen.call(this, 'login', [ - require('View:Admin:Login') - ]); - } - - _.extend(AdminLoginScreen.prototype, KnoinAbstractScreen.prototype); - - AdminLoginScreen.prototype.onShow = function () - { - require('App:Admin').setTitle(''); - }; - - module.exports = AdminLoginScreen; - -}()); \ No newline at end of file diff --git a/dev/Screens/AdminSettingsScreen.js b/dev/Screens/AdminSettingsScreen.js deleted file mode 100644 index c653f99f0..000000000 --- a/dev/Screens/AdminSettingsScreen.js +++ /dev/null @@ -1,79 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - - kn = require('App:Knoin'), - - AbstractSettings = require('Screen:AbstractSettings') - ; - - /** - * @constructor - * @extends AbstractSettings - */ - function AdminSettingsScreen() - { - AbstractSettings.call(this, [ - require('View:Admin:SettingsMenu'), - require('View:Admin:SettingsPane') - ]); - } - - _.extend(AdminSettingsScreen.prototype, AbstractSettings.prototype); - - /** - * @param {Function=} fCallback - */ - AdminSettingsScreen.prototype.setupSettings = function (fCallback) - { - kn.addSettingsViewModel(require('Settings:Admin:General'), - 'AdminSettingsGeneral', 'General', 'general', true); - - kn.addSettingsViewModel(require('Settings:Admin:Login'), - 'AdminSettingsLogin', 'Login', 'login'); - - kn.addSettingsViewModel(require('Settings:Admin:Branding'), - 'AdminSettingsBranding', 'Branding', 'branding'); - - kn.addSettingsViewModel(require('Settings:Admin:Contacts'), - 'AdminSettingsContacts', 'Contacts', 'contacts'); - - kn.addSettingsViewModel(require('Settings:Admin:Domains'), - 'AdminSettingsDomains', 'Domains', 'domains'); - - kn.addSettingsViewModel(require('Settings:Admin:Security'), - 'AdminSettingsSecurity', 'Security', 'security'); - - kn.addSettingsViewModel(require('Settings:Admin:Social'), - 'AdminSettingsSocial', 'Social', 'social'); - - kn.addSettingsViewModel(require('Settings:Admin:Plugins'), - 'AdminSettingsPlugins', 'Plugins', 'plugins'); - - kn.addSettingsViewModel(require('Settings:Admin:Packages'), - 'AdminSettingsPackages', 'Packages', 'packages'); - - kn.addSettingsViewModel(require('Settings:Admin:Licensing'), - 'AdminSettingsLicensing', 'Licensing', 'licensing'); - - kn.addSettingsViewModel(require('Settings:Admin:About'), - 'AdminSettingsAbout', 'About', 'about'); - - if (fCallback) - { - fCallback(); - } - }; - - AdminSettingsScreen.prototype.onShow = function () - { - require('App:Admin').setTitle(''); - }; - - module.exports = AdminSettingsScreen; - -}()); \ No newline at end of file diff --git a/dev/Screens/LoginScreen.js b/dev/Screens/LoginScreen.js deleted file mode 100644 index f809ebf45..000000000 --- a/dev/Screens/LoginScreen.js +++ /dev/null @@ -1,32 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - - KnoinAbstractScreen = require('Knoin:AbstractScreen') - ; - - /** - * @constructor - * @extends KnoinAbstractScreen - */ - function LoginScreen() - { - KnoinAbstractScreen.call(this, 'login', [ - require('View:RainLoop:Login') - ]); - } - - _.extend(LoginScreen.prototype, KnoinAbstractScreen.prototype); - - LoginScreen.prototype.onShow = function () - { - require('App:RainLoop').setTitle(''); - }; - - module.exports = LoginScreen; - -}()); \ No newline at end of file diff --git a/dev/Settings/Admin/AdminSettingsAbout.js b/dev/Settings/Admin/About.js similarity index 79% rename from dev/Settings/Admin/AdminSettingsAbout.js rename to dev/Settings/Admin/About.js index 92e3253c7..213aebb83 100644 --- a/dev/Settings/Admin/AdminSettingsAbout.js +++ b/dev/Settings/Admin/About.js @@ -10,11 +10,11 @@ /** * @constructor */ - function AdminSettingsAbout() + function AboutAdminSetting() { var - Settings = require('Storage:Settings'), - Data = require('Storage:Admin:Data') + Settings = require('Storage/Settings'), + Data = require('Storage/Admin/Data') ; this.version = ko.observable(Settings.settingsGet('Version')); @@ -67,22 +67,22 @@ }, this); } - AdminSettingsAbout.prototype.onBuild = function () + AboutAdminSetting.prototype.onBuild = function () { if (this.access()) { - require('App:Admin').reloadCoreData(); + require('App/Admin').reloadCoreData(); } }; - AdminSettingsAbout.prototype.updateCoreData = function () + AboutAdminSetting.prototype.updateCoreData = function () { if (!this.coreUpdating()) { - require('App:Admin').updateCoreData(); + require('App/Admin').updateCoreData(); } }; - module.exports = AdminSettingsAbout; + module.exports = AboutAdminSetting; }()); \ No newline at end of file diff --git a/dev/Settings/Admin/AdminSettingsBranding.js b/dev/Settings/Admin/Branding.js similarity index 90% rename from dev/Settings/Admin/AdminSettingsBranding.js rename to dev/Settings/Admin/Branding.js index 8f9c6c9e7..1956c0dce 100644 --- a/dev/Settings/Admin/AdminSettingsBranding.js +++ b/dev/Settings/Admin/Branding.js @@ -13,11 +13,11 @@ /** * @constructor */ - function AdminSettingsBranding() + function BrandingAdminSetting() { var Enums = require('Common/Enums'), - Settings = require('Storage:Settings') + Settings = require('Storage/Settings') ; this.title = ko.observable(Settings.settingsGet('Title')); @@ -36,11 +36,11 @@ this.loginCss.trigger = ko.observable(Enums.SaveSettingsStep.Idle); } - AdminSettingsBranding.prototype.onBuild = function () + BrandingAdminSetting.prototype.onBuild = function () { var self = this, - Remote = require('Storage:Admin:Remote') + Remote = require('Storage/Admin/Remote') ; _.delay(function () { @@ -86,6 +86,6 @@ }, 50); }; - module.exports = AdminSettingsBranding; + module.exports = BrandingAdminSetting; }()); \ No newline at end of file diff --git a/dev/Settings/Admin/AdminSettingsContacts.js b/dev/Settings/Admin/Contacts.js similarity index 93% rename from dev/Settings/Admin/AdminSettingsContacts.js rename to dev/Settings/Admin/Contacts.js index d0c25e2c8..318f48ce9 100644 --- a/dev/Settings/Admin/AdminSettingsContacts.js +++ b/dev/Settings/Admin/Contacts.js @@ -10,16 +10,16 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Settings = require('Storage:Settings') + Settings = require('Storage/Settings') ; /** * @constructor */ - function AdminSettingsContacts() + function ContactsAdminSetting() { var - Remote = require('Storage:Admin:Remote') + Remote = require('Storage/Admin/Remote') ; this.defautOptionsAfterRender = Utils.defautOptionsAfterRender; @@ -141,7 +141,7 @@ this.onTestContactsResponse = _.bind(this.onTestContactsResponse, this); } - AdminSettingsContacts.prototype.onTestContactsResponse = function (sResult, oData) + ContactsAdminSetting.prototype.onTestContactsResponse = function (sResult, oData) { this.testContactsSuccess(false); this.testContactsError(false); @@ -167,18 +167,18 @@ this.testing(false); }; - AdminSettingsContacts.prototype.onShow = function () + ContactsAdminSetting.prototype.onShow = function () { this.testContactsSuccess(false); this.testContactsError(false); this.testContactsErrorMessage(''); }; - AdminSettingsContacts.prototype.onBuild = function () + ContactsAdminSetting.prototype.onBuild = function () { var self = this, - Remote = require('Storage:Admin:Remote') + Remote = require('Storage/Admin/Remote') ; _.delay(function () { @@ -237,6 +237,6 @@ }, 50); }; - module.exports = AdminSettingsContacts; + module.exports = ContactsAdminSetting; }()); \ No newline at end of file diff --git a/dev/Settings/Admin/AdminSettingsDomains.js b/dev/Settings/Admin/Domains.js similarity index 63% rename from dev/Settings/Admin/AdminSettingsDomains.js rename to dev/Settings/Admin/Domains.js index b14fa0330..5bb60970e 100644 --- a/dev/Settings/Admin/AdminSettingsDomains.js +++ b/dev/Settings/Admin/Domains.js @@ -10,16 +10,16 @@ Enums = require('Common/Enums'), - PopupsDomainViewModel = require('View:Popup:Domain'), + PopupsDomainViewModel = require('View/Popup/Domain'), - Data = require('Storage:Admin:Data'), - Remote = require('Storage:Admin:Remote') + Data = require('Storage/Admin/Data'), + Remote = require('Storage/Admin/Remote') ; /** * @constructor */ - function AdminSettingsDomains() + function DomainsAdminSetting() { this.domains = Data.domains; this.domainsLoading = Data.domainsLoading; @@ -46,7 +46,7 @@ ]}); } - AdminSettingsDomains.prototype.startDomainForDeletionTimeout = function () + DomainsAdminSetting.prototype.startDomainForDeletionTimeout = function () { var self = this; window.clearInterval(this.iDomainForDeletionTimeout); @@ -55,24 +55,24 @@ }, 1000 * 3); }; - AdminSettingsDomains.prototype.createDomain = function () + DomainsAdminSetting.prototype.createDomain = function () { - require('App:Knoin').showScreenPopup(PopupsDomainViewModel); + require('Knoin/Knoin').showScreenPopup(PopupsDomainViewModel); }; - AdminSettingsDomains.prototype.deleteDomain = function (oDomain) + DomainsAdminSetting.prototype.deleteDomain = function (oDomain) { this.domains.remove(oDomain); Remote.domainDelete(_.bind(this.onDomainListChangeRequest, this), oDomain.name); }; - AdminSettingsDomains.prototype.disableDomain = function (oDomain) + DomainsAdminSetting.prototype.disableDomain = function (oDomain) { oDomain.disabled(!oDomain.disabled()); Remote.domainDisable(_.bind(this.onDomainListChangeRequest, this), oDomain.name, oDomain.disabled()); }; - AdminSettingsDomains.prototype.onBuild = function (oDom) + DomainsAdminSetting.prototype.onBuild = function (oDom) { var self = this; oDom @@ -85,22 +85,22 @@ }) ; - require('App:Admin').reloadDomainList(); + require('App/Admin').reloadDomainList(); }; - AdminSettingsDomains.prototype.onDomainLoadRequest = function (sResult, oData) + DomainsAdminSetting.prototype.onDomainLoadRequest = function (sResult, oData) { if (Enums.StorageResultType.Success === sResult && oData && oData.Result) { - require('App:Knoin').showScreenPopup(PopupsDomainViewModel, [oData.Result]); + require('Knoin/Knoin').showScreenPopup(PopupsDomainViewModel, [oData.Result]); } }; - AdminSettingsDomains.prototype.onDomainListChangeRequest = function () + DomainsAdminSetting.prototype.onDomainListChangeRequest = function () { - require('App:Admin').reloadDomainList(); + require('App/Admin').reloadDomainList(); }; - module.exports = AdminSettingsDomains; + module.exports = DomainsAdminSetting; }()); \ No newline at end of file diff --git a/dev/Settings/Admin/AdminSettingsGeneral.js b/dev/Settings/Admin/General.js similarity index 88% rename from dev/Settings/Admin/AdminSettingsGeneral.js rename to dev/Settings/Admin/General.js index b287f371e..c19651053 100644 --- a/dev/Settings/Admin/AdminSettingsGeneral.js +++ b/dev/Settings/Admin/General.js @@ -11,14 +11,14 @@ Utils = require('Common/Utils'), LinkBuilder = require('Common/LinkBuilder'), - Settings = require('Storage:Settings'), - Data = require('Storage:Admin:Data') + Settings = require('Storage/Settings'), + Data = require('Storage/Admin/Data') ; /** * @constructor */ - function AdminSettingsGeneral() + function GeneralAdminSetting() { this.mainLanguage = Data.mainLanguage; this.mainTheme = Data.mainTheme; @@ -61,11 +61,11 @@ this.themeTrigger = ko.observable(Enums.SaveSettingsStep.Idle); } - AdminSettingsGeneral.prototype.onBuild = function () + GeneralAdminSetting.prototype.onBuild = function () { var self = this, - Remote = require('Storage:Admin:Remote') + Remote = require('Storage/Admin/Remote') ; _.delay(function () { @@ -127,19 +127,19 @@ }, 50); }; - AdminSettingsGeneral.prototype.selectLanguage = function () + GeneralAdminSetting.prototype.selectLanguage = function () { - require('App:Knoin').showScreenPopup(require('View:Popup:Languages')); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/Languages')); }; /** * @return {string} */ - AdminSettingsGeneral.prototype.phpInfoLink = function () + GeneralAdminSetting.prototype.phpInfoLink = function () { return LinkBuilder.phpInfo(); }; - module.exports = AdminSettingsGeneral; + module.exports = GeneralAdminSetting; }()); \ No newline at end of file diff --git a/dev/Settings/Admin/AdminSettingsLicensing.js b/dev/Settings/Admin/Licensing.js similarity index 62% rename from dev/Settings/Admin/AdminSettingsLicensing.js rename to dev/Settings/Admin/Licensing.js index c17781c78..9132bfe8a 100644 --- a/dev/Settings/Admin/AdminSettingsLicensing.js +++ b/dev/Settings/Admin/Licensing.js @@ -7,14 +7,14 @@ ko = require('ko'), moment = require('moment'), - Settings = require('Storage:Settings'), - Data = require('Storage:Admin:Data') + Settings = require('Storage/Settings'), + Data = require('Storage/Admin/Data') ; /** * @constructor */ - function AdminSettingsLicensing() + function LicensingAdminSetting() { this.licensing = Data.licensing; this.licensingProcess = Data.licensingProcess; @@ -29,33 +29,33 @@ this.licenseTrigger.subscribe(function () { if (this.subscriptionEnabled()) { - require('App:Admin').reloadLicensing(true); + require('App/Admin').reloadLicensing(true); } }, this); } - AdminSettingsLicensing.prototype.onBuild = function () + LicensingAdminSetting.prototype.onBuild = function () { if (this.subscriptionEnabled()) { - require('App:Admin').reloadLicensing(false); + require('App/Admin').reloadLicensing(false); } }; - AdminSettingsLicensing.prototype.onShow = function () + LicensingAdminSetting.prototype.onShow = function () { this.adminDomain(Settings.settingsGet('AdminDomain')); }; - AdminSettingsLicensing.prototype.showActivationForm = function () + LicensingAdminSetting.prototype.showActivationForm = function () { - require('App:Knoin').showScreenPopup(require('View:Popup:Activate')); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/Activate')); }; /** * @returns {string} */ - AdminSettingsLicensing.prototype.licenseExpiredMomentValue = function () + LicensingAdminSetting.prototype.licenseExpiredMomentValue = function () { var iTime = this.licenseExpired(), @@ -65,6 +65,6 @@ return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')'); }; - module.exports = AdminSettingsLicensing; + module.exports = LicensingAdminSetting; }()); \ No newline at end of file diff --git a/dev/Settings/Admin/AdminSettingsLogin.js b/dev/Settings/Admin/Login.js similarity index 84% rename from dev/Settings/Admin/AdminSettingsLogin.js rename to dev/Settings/Admin/Login.js index 801b7694e..f3e6a0503 100644 --- a/dev/Settings/Admin/AdminSettingsLogin.js +++ b/dev/Settings/Admin/Login.js @@ -10,14 +10,14 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Settings = require('Storage:Settings'), - Data = require('Storage:Admin:Data') + Settings = require('Storage/Settings'), + Data = require('Storage/Admin/Data') ; /** * @constructor */ - function AdminSettingsLogin() + function LoginAdminSetting() { this.determineUserLanguage = Data.determineUserLanguage; this.determineUserDomain = Data.determineUserDomain; @@ -28,11 +28,11 @@ this.defaultDomainTrigger = ko.observable(Enums.SaveSettingsStep.Idle); } - AdminSettingsLogin.prototype.onBuild = function () + LoginAdminSetting.prototype.onBuild = function () { var self = this, - Remote = require('Storage:Admin:Remote') + Remote = require('Storage/Admin/Remote') ; _.delay(function () { @@ -66,6 +66,6 @@ }, 50); }; - module.exports = AdminSettingsLogin; + module.exports = LoginAdminSetting; }()); \ No newline at end of file diff --git a/dev/Settings/Admin/AdminSettingsPackages.js b/dev/Settings/Admin/Packages.js similarity index 78% rename from dev/Settings/Admin/AdminSettingsPackages.js rename to dev/Settings/Admin/Packages.js index 22a60fc15..0395083ce 100644 --- a/dev/Settings/Admin/AdminSettingsPackages.js +++ b/dev/Settings/Admin/Packages.js @@ -10,14 +10,14 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Data = require('Storage:Admin:Data'), - Remote = require('Storage:Admin:Remote') + Data = require('Storage/Admin/Data'), + Remote = require('Storage/Admin/Remote') ; /** * @constructor */ - function AdminSettingsPackages() + function PackagesAdminSetting() { this.packagesError = ko.observable(''); @@ -43,17 +43,17 @@ }, this); } - AdminSettingsPackages.prototype.onShow = function () + PackagesAdminSetting.prototype.onShow = function () { this.packagesError(''); }; - AdminSettingsPackages.prototype.onBuild = function () + PackagesAdminSetting.prototype.onBuild = function () { - require('App:Admin').reloadPackagesList(); + require('App/Admin').reloadPackagesList(); }; - AdminSettingsPackages.prototype.requestHelper = function (oPackage, bInstall) + PackagesAdminSetting.prototype.requestHelper = function (oPackage, bInstall) { var self = this; return function (sResult, oData) { @@ -85,12 +85,12 @@ } else { - require('App:Admin').reloadPackagesList(); + require('App/Admin').reloadPackagesList(); } }; }; - AdminSettingsPackages.prototype.deletePackage = function (oPackage) + PackagesAdminSetting.prototype.deletePackage = function (oPackage) { if (oPackage) { @@ -99,7 +99,7 @@ } }; - AdminSettingsPackages.prototype.installPackage = function (oPackage) + PackagesAdminSetting.prototype.installPackage = function (oPackage) { if (oPackage) { @@ -108,6 +108,6 @@ } }; - module.exports = AdminSettingsPackages; + module.exports = PackagesAdminSetting; }()); \ No newline at end of file diff --git a/dev/Settings/Admin/AdminSettingsPlugins.js b/dev/Settings/Admin/Plugins.js similarity index 70% rename from dev/Settings/Admin/AdminSettingsPlugins.js rename to dev/Settings/Admin/Plugins.js index 8471c21d7..6841ee7d2 100644 --- a/dev/Settings/Admin/AdminSettingsPlugins.js +++ b/dev/Settings/Admin/Plugins.js @@ -10,15 +10,15 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Settings = require('Storage:Settings'), - Data = require('Storage:Admin:Data'), - Remote = require('Storage:Admin:Remote') + Settings = require('Storage/Settings'), + Data = require('Storage/Admin/Data'), + Remote = require('Storage/Admin/Remote') ; /** * @constructor */ - function AdminSettingsPlugins() + function PluginsAdminSetting() { this.enabledPlugins = ko.observable(!!Settings.settingsGet('EnabledPlugins')); @@ -35,18 +35,18 @@ this.onPluginDisableRequest = _.bind(this.onPluginDisableRequest, this); } - AdminSettingsPlugins.prototype.disablePlugin = function (oPlugin) + PluginsAdminSetting.prototype.disablePlugin = function (oPlugin) { oPlugin.disabled(!oPlugin.disabled()); Remote.pluginDisable(this.onPluginDisableRequest, oPlugin.name, oPlugin.disabled()); }; - AdminSettingsPlugins.prototype.configurePlugin = function (oPlugin) + PluginsAdminSetting.prototype.configurePlugin = function (oPlugin) { Remote.plugin(this.onPluginLoadRequest, oPlugin.name); }; - AdminSettingsPlugins.prototype.onBuild = function (oDom) + PluginsAdminSetting.prototype.onBuild = function (oDom) { var self = this; @@ -74,21 +74,21 @@ }); }; - AdminSettingsPlugins.prototype.onShow = function () + PluginsAdminSetting.prototype.onShow = function () { this.pluginsError(''); - require('App:Admin').reloadPluginList(); + require('App/Admin').reloadPluginList(); }; - AdminSettingsPlugins.prototype.onPluginLoadRequest = function (sResult, oData) + PluginsAdminSetting.prototype.onPluginLoadRequest = function (sResult, oData) { if (Enums.StorageResultType.Success === sResult && oData && oData.Result) { - require('App:Knoin').showScreenPopup(require('View:Popup:Plugin'), [oData.Result]); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/Plugin'), [oData.Result]); } }; - AdminSettingsPlugins.prototype.onPluginDisableRequest = function (sResult, oData) + PluginsAdminSetting.prototype.onPluginDisableRequest = function (sResult, oData) { if (Enums.StorageResultType.Success === sResult && oData) { @@ -105,9 +105,9 @@ } } - require('App:Admin').reloadPluginList(); + require('App/Admin').reloadPluginList(); }; - module.exports = AdminSettingsPlugins; + module.exports = PluginsAdminSetting; }()); \ No newline at end of file diff --git a/dev/Settings/Admin/AdminSettingsSecurity.js b/dev/Settings/Admin/Security.js similarity index 85% rename from dev/Settings/Admin/AdminSettingsSecurity.js rename to dev/Settings/Admin/Security.js index 1e882f306..951ed8fe3 100644 --- a/dev/Settings/Admin/AdminSettingsSecurity.js +++ b/dev/Settings/Admin/Security.js @@ -11,15 +11,15 @@ Utils = require('Common/Utils'), LinkBuilder = require('Common/LinkBuilder'), - Settings = require('Storage:Settings'), - Data = require('Storage:Admin:Data'), - Remote = require('Storage:Admin:Remote') + Settings = require('Storage/Settings'), + Data = require('Storage/Admin/Data'), + Remote = require('Storage/Admin/Remote') ; /** * @constructor */ - function AdminSettingsSecurity() + function SecurityAdminSetting() { this.useLocalProxyForExternalImages = Data.useLocalProxyForExternalImages; @@ -75,7 +75,7 @@ this.onNewAdminPasswordResponse = _.bind(this.onNewAdminPasswordResponse, this); } - AdminSettingsSecurity.prototype.onNewAdminPasswordResponse = function (sResult, oData) + SecurityAdminSetting.prototype.onNewAdminPasswordResponse = function (sResult, oData) { if (Enums.StorageResultType.Success === sResult && oData && oData.Result) { @@ -91,10 +91,10 @@ } }; - AdminSettingsSecurity.prototype.onBuild = function () + SecurityAdminSetting.prototype.onBuild = function () { var - Remote = require('Storage:Admin:Remote') + Remote = require('Storage/Admin/Remote') ; this.capaOpenPGP.subscribe(function (bValue) { @@ -116,7 +116,7 @@ }); }; - AdminSettingsSecurity.prototype.onHide = function () + SecurityAdminSetting.prototype.onHide = function () { this.adminPassword(''); this.adminPasswordNew(''); @@ -126,11 +126,11 @@ /** * @return {string} */ - AdminSettingsSecurity.prototype.phpInfoLink = function () + SecurityAdminSetting.prototype.phpInfoLink = function () { return LinkBuilder.phpInfo(); }; - module.exports = AdminSettingsSecurity; + module.exports = SecurityAdminSetting; }()); diff --git a/dev/Settings/Admin/AdminSettingsSocial.js b/dev/Settings/Admin/Social.js similarity index 94% rename from dev/Settings/Admin/AdminSettingsSocial.js rename to dev/Settings/Admin/Social.js index 7924727df..8336a1547 100644 --- a/dev/Settings/Admin/AdminSettingsSocial.js +++ b/dev/Settings/Admin/Social.js @@ -14,14 +14,15 @@ /** * @constructor */ - function AdminSettingsSocial() + function SocialAdminSetting() { - var Data = require('Storage:Admin:Data'); + var Data = require('Storage/Admin/Data'); this.googleEnable = Data.googleEnable; this.googleClientID = Data.googleClientID; this.googleApiKey = Data.googleApiKey; this.googleClientSecret = Data.googleClientSecret; + this.googleTrigger1 = ko.observable(Enums.SaveSettingsStep.Idle); this.googleTrigger2 = ko.observable(Enums.SaveSettingsStep.Idle); this.googleTrigger3 = ko.observable(Enums.SaveSettingsStep.Idle); @@ -44,11 +45,11 @@ this.dropboxTrigger1 = ko.observable(Enums.SaveSettingsStep.Idle); } - AdminSettingsSocial.prototype.onBuild = function () + SocialAdminSetting.prototype.onBuild = function () { var self = this, - Remote = require('Storage:Admin:Remote') + Remote = require('Storage/Admin/Remote') ; _.delay(function () { @@ -148,6 +149,6 @@ }, 50); }; - module.exports = AdminSettingsSocial; + module.exports = SocialAdminSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsAccounts.js b/dev/Settings/App/Accounts.js similarity index 78% rename from dev/Settings/App/SettingsAccounts.js rename to dev/Settings/App/Accounts.js index 50ff86c05..9f1228cb5 100644 --- a/dev/Settings/App/SettingsAccounts.js +++ b/dev/Settings/App/Accounts.js @@ -12,14 +12,14 @@ Utils = require('Common/Utils'), LinkBuilder = require('Common/LinkBuilder'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote') + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote') ; /** * @constructor */ - function SettingsAccounts() + function AccountsAppSetting() { this.accounts = Data.accounts; @@ -46,22 +46,22 @@ ]}); } - SettingsAccounts.prototype.addNewAccount = function () + AccountsAppSetting.prototype.addNewAccount = function () { - require('App:Knoin').showScreenPopup(require('View:Popup:AddAccount')); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount')); }; /** * @param {AccountModel} oAccountToRemove */ - SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove) + AccountsAppSetting.prototype.deleteAccount = function (oAccountToRemove) { if (oAccountToRemove && oAccountToRemove.deleteAccess()) { this.accountForDeletion(null); var - kn = require('App:Knoin'), + kn = require('Knoin/Knoin'), fRemoveAccount = function (oAccount) { return oAccountToRemove === oAccount; } @@ -86,7 +86,7 @@ } else { - require('App:RainLoop').accountsAndIdentities(); + require('App/App').accountsAndIdentities(); } }, oAccountToRemove.email); @@ -94,6 +94,6 @@ } }; - module.exports = SettingsAccounts; + module.exports = AccountsAppSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsChangePassword.js b/dev/Settings/App/ChangePassword.js similarity index 91% rename from dev/Settings/App/SettingsChangePassword.js rename to dev/Settings/App/ChangePassword.js index c11c67353..1b77472af 100644 --- a/dev/Settings/App/SettingsChangePassword.js +++ b/dev/Settings/App/ChangePassword.js @@ -10,13 +10,13 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Remote = require('Storage:RainLoop:Remote') + Remote = require('Storage/App/Remote') ; /** * @constructor */ - function SettingsChangePassword() + function ChangePasswordAppSetting() { this.changeProcess = ko.observable(false); @@ -76,7 +76,7 @@ this.onChangePasswordResponse = _.bind(this.onChangePasswordResponse, this); } - SettingsChangePassword.prototype.onHide = function () + ChangePasswordAppSetting.prototype.onHide = function () { this.changeProcess(false); this.currentPassword(''); @@ -87,7 +87,7 @@ this.currentPassword.error(false); }; - SettingsChangePassword.prototype.onChangePasswordResponse = function (sResult, oData) + ChangePasswordAppSetting.prototype.onChangePasswordResponse = function (sResult, oData) { this.changeProcess(false); this.passwordMismatch(false); @@ -116,6 +116,6 @@ } }; - module.exports = SettingsChangePassword; + module.exports = ChangePasswordAppSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsContacts.js b/dev/Settings/App/Contacts.js similarity index 80% rename from dev/Settings/App/SettingsContacts.js rename to dev/Settings/App/Contacts.js index d2ae55609..46c3d3e3c 100644 --- a/dev/Settings/App/SettingsContacts.js +++ b/dev/Settings/App/Contacts.js @@ -6,16 +6,14 @@ var ko = require('ko'), - Utils = require('Common/Utils'), - - Remote = require('Storage:RainLoop:Remote'), - Data = require('Storage:RainLoop:Data') + Remote = require('Storage/App/Remote'), + Data = require('Storage/App/Data') ; /** * @constructor */ - function SettingsContacts() + function ContactsAppSetting() { this.contactsAutosave = Data.contactsAutosave; @@ -44,7 +42,7 @@ }, this); } - SettingsContacts.prototype.onBuild = function () + ContactsAppSetting.prototype.onBuild = function () { Data.contactsAutosave.subscribe(function (bValue) { Remote.saveSettings(null, { @@ -53,6 +51,6 @@ }); }; - module.exports = SettingsContacts; + module.exports = ContactsAppSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsFilters.js b/dev/Settings/App/Filters.js similarity index 58% rename from dev/Settings/App/SettingsFilters.js rename to dev/Settings/App/Filters.js index 1ec2c476b..dde98a067 100644 --- a/dev/Settings/App/SettingsFilters.js +++ b/dev/Settings/App/Filters.js @@ -12,7 +12,7 @@ /** * @constructor */ - function SettingsFilters() + function FiltersAppSetting() { this.filters = ko.observableArray([]); this.filters.loading = ko.observable(false); @@ -22,21 +22,21 @@ }); } - SettingsFilters.prototype.deleteFilter = function (oFilter) + FiltersAppSetting.prototype.deleteFilter = function (oFilter) { this.filters.remove(oFilter); }; - SettingsFilters.prototype.addFilter = function () + FiltersAppSetting.prototype.addFilter = function () { var FilterModel = require('Model/Filter') ; - require('App:Knoin').showScreenPopup( - require('View:Popup:Filter'), [new FilterModel()]); + require('Knoin/Knoin').showScreenPopup( + require('View/Popup/Filter'), [new FilterModel()]); }; - module.exports = SettingsFilters; + module.exports = FiltersAppSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsFolders.js b/dev/Settings/App/Folders.js similarity index 74% rename from dev/Settings/App/SettingsFolders.js rename to dev/Settings/App/Folders.js index d505428ec..a3a4262c0 100644 --- a/dev/Settings/App/SettingsFolders.js +++ b/dev/Settings/App/Folders.js @@ -9,17 +9,17 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Settings = require('Storage:Settings'), - Data = require('Storage:RainLoop:Data'), - Cache = require('Storage:RainLoop:Cache'), - Remote = require('Storage:RainLoop:Remote'), - LocalStorage = require('Storage:LocalStorage') + Settings = require('Storage/Settings'), + Data = require('Storage/App/Data'), + Cache = require('Storage/App/Cache'), + Remote = require('Storage/App/Remote'), + Local = require('Storage/Local') ; /** * @constructor */ - function SettingsFolders() + function FoldersAppSetting() { this.foldersListError = Data.foldersListError; this.folderList = Data.folderList; @@ -89,7 +89,7 @@ this.useImapSubscribe = !!Settings.settingsGet('UseImapSubscribe'); } - SettingsFolders.prototype.folderEditOnEnter = function (oFolder) + FoldersAppSetting.prototype.folderEditOnEnter = function (oFolder) { var sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : '' @@ -97,7 +97,7 @@ if ('' !== sEditName && oFolder.name() !== sEditName) { - LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, ''); + Local.set(Enums.ClientSideKeyName.FoldersLashHash, ''); Data.foldersRenaming(true); Remote.folderRename(function (sResult, oData) { @@ -109,7 +109,7 @@ oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_RENAME_FOLDER')); } - require('App:RainLoop').folders(); + require('App/App').folders(); }, oFolder.fullNameRaw, sEditName); @@ -121,7 +121,7 @@ oFolder.edited(false); }; - SettingsFolders.prototype.folderEditOnEsc = function (oFolder) + FoldersAppSetting.prototype.folderEditOnEsc = function (oFolder) { if (oFolder) { @@ -129,22 +129,22 @@ } }; - SettingsFolders.prototype.onShow = function () + FoldersAppSetting.prototype.onShow = function () { Data.foldersListError(''); }; - SettingsFolders.prototype.createFolder = function () + FoldersAppSetting.prototype.createFolder = function () { - require('App:Knoin').showScreenPopup(require('View:Popup:FolderCreate')); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderCreate')); }; - SettingsFolders.prototype.systemFolder = function () + FoldersAppSetting.prototype.systemFolder = function () { - require('App:Knoin').showScreenPopup(require('View:Popup:FolderSystem')); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderSystem')); }; - SettingsFolders.prototype.deleteFolder = function (oFolderToRemove) + FoldersAppSetting.prototype.deleteFolder = function (oFolderToRemove) { if (oFolderToRemove && oFolderToRemove.canBeDeleted() && oFolderToRemove.deleteAccess() && 0 === oFolderToRemove.privateMessageCountAll()) @@ -166,7 +166,7 @@ if (oFolderToRemove) { - LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, ''); + Local.set(Enums.ClientSideKeyName.FoldersLashHash, ''); Data.folderList.remove(fRemoveFolder); @@ -180,7 +180,7 @@ oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_DELETE_FOLDER')); } - require('App:RainLoop').folders(); + require('App/App').folders(); }, oFolderToRemove.fullNameRaw); @@ -193,22 +193,22 @@ } }; - SettingsFolders.prototype.subscribeFolder = function (oFolder) + FoldersAppSetting.prototype.subscribeFolder = function (oFolder) { - LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, ''); + Local.set(Enums.ClientSideKeyName.FoldersLashHash, ''); Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, true); oFolder.subScribed(true); }; - SettingsFolders.prototype.unSubscribeFolder = function (oFolder) + FoldersAppSetting.prototype.unSubscribeFolder = function (oFolder) { - LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, ''); + Local.set(Enums.ClientSideKeyName.FoldersLashHash, ''); Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, false); oFolder.subScribed(false); }; - module.exports = SettingsFolders; + module.exports = FoldersAppSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsGeneral.js b/dev/Settings/App/General.js similarity index 88% rename from dev/Settings/App/SettingsGeneral.js rename to dev/Settings/App/General.js index 6682dbbc4..1a867f7aa 100644 --- a/dev/Settings/App/SettingsGeneral.js +++ b/dev/Settings/App/General.js @@ -5,23 +5,21 @@ var _ = require('_'), - $ = require('$'), ko = require('ko'), Enums = require('Common/Enums'), Consts = require('Common/Consts'), Globals = require('Common/Globals'), Utils = require('Common/Utils'), - LinkBuilder = require('Common/LinkBuilder'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote') + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote') ; /** * @constructor */ - function SettingsGeneral() + function GeneralAppSetting() { this.mainLanguage = Data.mainLanguage; this.mainMessagesPerPage = Data.mainMessagesPerPage; @@ -57,12 +55,12 @@ this.isAnimationSupported = Globals.bAnimationSupported; } - SettingsGeneral.prototype.toggleLayout = function () + GeneralAppSetting.prototype.toggleLayout = function () { this.layout(Enums.Layout.NoPreview === this.layout() ? Enums.Layout.SidePreview : Enums.Layout.NoPreview); }; - SettingsGeneral.prototype.onBuild = function () + GeneralAppSetting.prototype.onBuild = function () { var self = this; @@ -158,16 +156,16 @@ }, 50); }; - SettingsGeneral.prototype.onShow = function () + GeneralAppSetting.prototype.onShow = function () { Data.desktopNotifications.valueHasMutated(); }; - SettingsGeneral.prototype.selectLanguage = function () + GeneralAppSetting.prototype.selectLanguage = function () { - require('App:Knoin').showScreenPopup(require('View:Popup:Languages')); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/Languages')); }; - module.exports = SettingsGeneral; + module.exports = GeneralAppSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsIdentities.js b/dev/Settings/App/Identities.js similarity index 85% rename from dev/Settings/App/SettingsIdentities.js rename to dev/Settings/App/Identities.js index d3b1f9edf..7c681981e 100644 --- a/dev/Settings/App/SettingsIdentities.js +++ b/dev/Settings/App/Identities.js @@ -11,14 +11,14 @@ Utils = require('Common/Utils'), HtmlEditor = require('Common/HtmlEditor'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote') + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote') ; /** * @constructor */ - function SettingsIdentities() + function IdentitiesAppSetting() { this.editor = null; this.defautOptionsAfterRender = Utils.defautOptionsAfterRender; @@ -100,7 +100,7 @@ * * @return {string} */ - SettingsIdentities.prototype.formattedAccountIdentity = function () + IdentitiesAppSetting.prototype.formattedAccountIdentity = function () { var sDisplayName = this.displayName.peek(), @@ -110,20 +110,20 @@ return '' === sDisplayName ? sEmail : '"' + Utils.quoteName(sDisplayName) + '" <' + sEmail + '>'; }; - SettingsIdentities.prototype.addNewIdentity = function () + IdentitiesAppSetting.prototype.addNewIdentity = function () { - require('App:Knoin').showScreenPopup(require('View:Popup:Identity')); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity')); }; - SettingsIdentities.prototype.editIdentity = function (oIdentity) + IdentitiesAppSetting.prototype.editIdentity = function (oIdentity) { - require('App:Knoin').showScreenPopup(require('View:Popup:Identity'), [oIdentity]); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'), [oIdentity]); }; /** * @param {IdentityModel} oIdentityToRemove */ - SettingsIdentities.prototype.deleteIdentity = function (oIdentityToRemove) + IdentitiesAppSetting.prototype.deleteIdentity = function (oIdentityToRemove) { if (oIdentityToRemove && oIdentityToRemove.deleteAccess()) { @@ -140,13 +140,13 @@ this.identities.remove(fRemoveFolder); Remote.identityDelete(function () { - require('App:RainLoop').accountsAndIdentities(); + require('App/App').accountsAndIdentities(); }, oIdentityToRemove.id); } } }; - SettingsIdentities.prototype.onFocus = function () + IdentitiesAppSetting.prototype.onFocus = function () { if (!this.editor && this.signatureDom()) { @@ -172,7 +172,7 @@ } }; - SettingsIdentities.prototype.onBuild = function (oDom) + IdentitiesAppSetting.prototype.onBuild = function (oDom) { var self = this; @@ -228,6 +228,6 @@ }, 50); }; - module.exports = SettingsIdentities; + module.exports = IdentitiesAppSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsIdentity.js b/dev/Settings/App/Identity.js similarity index 88% rename from dev/Settings/App/SettingsIdentity.js rename to dev/Settings/App/Identity.js index 8c0e1e64e..a72c9f8aa 100644 --- a/dev/Settings/App/SettingsIdentity.js +++ b/dev/Settings/App/Identity.js @@ -11,14 +11,14 @@ Utils = require('Common/Utils'), HtmlEditor = require('Common/HtmlEditor'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote') + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote') ; /** * @constructor */ - function SettingsIdentity() + function IdentityAppSetting() { this.editor = null; @@ -34,7 +34,7 @@ this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle); } - SettingsIdentity.prototype.onFocus = function () + IdentityAppSetting.prototype.onFocus = function () { if (!this.editor && this.signatureDom()) { @@ -60,7 +60,7 @@ } }; - SettingsIdentity.prototype.onBuild = function () + IdentityAppSetting.prototype.onBuild = function () { var self = this; _.delay(function () { @@ -98,6 +98,6 @@ }, 50); }; - module.exports = SettingsIdentity; + module.exports = IdentityAppSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsOpenPGP.js b/dev/Settings/App/OpenPGP.js similarity index 64% rename from dev/Settings/App/SettingsOpenPGP.js rename to dev/Settings/App/OpenPGP.js index 3ca65d6ed..143bdea07 100644 --- a/dev/Settings/App/SettingsOpenPGP.js +++ b/dev/Settings/App/OpenPGP.js @@ -6,15 +6,15 @@ var ko = require('ko'), - kn = require('App:Knoin'), + kn = require('Knoin/Knoin'), - Data = require('Storage:RainLoop:Data') + Data = require('Storage/App/Data') ; /** * @constructor */ - function SettingsOpenPGP() + function OpenPGPAppSetting() { this.openpgpkeys = Data.openpgpkeys; this.openpgpkeysPublic = Data.openpgpkeysPublic; @@ -35,28 +35,28 @@ ]}); } - SettingsOpenPGP.prototype.addOpenPgpKey = function () + OpenPGPAppSetting.prototype.addOpenPgpKey = function () { - kn.showScreenPopup(require('View:Popup:AddOpenPgpKey')); + kn.showScreenPopup(require('View/Popup/AddOpenPgpKey')); }; - SettingsOpenPGP.prototype.generateOpenPgpKey = function () + OpenPGPAppSetting.prototype.generateOpenPgpKey = function () { - kn.showScreenPopup(require('View:Popup:NewOpenPgpKey')); + kn.showScreenPopup(require('View/Popup/NewOpenPgpKey')); }; - SettingsOpenPGP.prototype.viewOpenPgpKey = function (oOpenPgpKey) + OpenPGPAppSetting.prototype.viewOpenPgpKey = function (oOpenPgpKey) { if (oOpenPgpKey) { - kn.showScreenPopup(require('View:Popup:ViewOpenPgpKey'), [oOpenPgpKey]); + kn.showScreenPopup(require('View/Popup/ViewOpenPgpKey'), [oOpenPgpKey]); } }; /** * @param {OpenPgpKeyModel} oOpenPgpKeyToRemove */ - SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove) + OpenPGPAppSetting.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove) { if (oOpenPgpKeyToRemove && oOpenPgpKeyToRemove.deleteAccess()) { @@ -73,11 +73,11 @@ Data.openpgpKeyring.store(); - require('App:RainLoop').reloadOpenPgpKeys(); + require('App/App').reloadOpenPgpKeys(); } } }; - module.exports = SettingsOpenPGP; + module.exports = OpenPGPAppSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsSecurity.js b/dev/Settings/App/Security.js similarity index 79% rename from dev/Settings/App/SettingsSecurity.js rename to dev/Settings/App/Security.js index 18f576e8f..c5d284e3a 100644 --- a/dev/Settings/App/SettingsSecurity.js +++ b/dev/Settings/App/Security.js @@ -10,13 +10,13 @@ Globals = require('Common/Globals'), Utils = require('Common/Utils'), - Remote = require('Storage:RainLoop:Remote') + Remote = require('Storage/App/Remote') ; /** * @constructor */ - function SettingsSecurity() + function SecurityAppSetting() { this.processing = ko.observable(false); this.clearing = ko.observable(false); @@ -46,37 +46,37 @@ this.onSecretResult = _.bind(this.onSecretResult, this); } - SettingsSecurity.prototype.showSecret = function () + SecurityAppSetting.prototype.showSecret = function () { this.secreting(true); Remote.showTwoFactorSecret(this.onSecretResult); }; - SettingsSecurity.prototype.hideSecret = function () + SecurityAppSetting.prototype.hideSecret = function () { this.viewSecret(''); this.viewBackupCodes(''); this.viewUrl(''); }; - SettingsSecurity.prototype.createTwoFactor = function () + SecurityAppSetting.prototype.createTwoFactor = function () { this.processing(true); Remote.createTwoFactor(this.onResult); }; - SettingsSecurity.prototype.enableTwoFactor = function () + SecurityAppSetting.prototype.enableTwoFactor = function () { this.processing(true); Remote.enableTwoFactor(this.onResult, this.viewEnable()); }; - SettingsSecurity.prototype.testTwoFactor = function () + SecurityAppSetting.prototype.testTwoFactor = function () { - require('App:Knoin').showScreenPopup(require('View:Popup:TwoFactorTest')); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/TwoFactorTest')); }; - SettingsSecurity.prototype.clearTwoFactor = function () + SecurityAppSetting.prototype.clearTwoFactor = function () { this.viewSecret(''); this.viewBackupCodes(''); @@ -86,14 +86,14 @@ Remote.clearTwoFactor(this.onResult); }; - SettingsSecurity.prototype.onShow = function () + SecurityAppSetting.prototype.onShow = function () { this.viewSecret(''); this.viewBackupCodes(''); this.viewUrl(''); }; - SettingsSecurity.prototype.onResult = function (sResult, oData) + SecurityAppSetting.prototype.onResult = function (sResult, oData) { this.processing(false); this.clearing(false); @@ -139,7 +139,7 @@ } }; - SettingsSecurity.prototype.onSecretResult = function (sResult, oData) + SecurityAppSetting.prototype.onSecretResult = function (sResult, oData) { this.secreting(false); @@ -155,12 +155,12 @@ } }; - SettingsSecurity.prototype.onBuild = function () + SecurityAppSetting.prototype.onBuild = function () { this.processing(true); Remote.getTwoFactor(this.onResult); }; - module.exports = SettingsSecurity; + module.exports = SecurityAppSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsSocial.js b/dev/Settings/App/Social.js similarity index 79% rename from dev/Settings/App/SettingsSocial.js rename to dev/Settings/App/Social.js index 1f753d2a5..b2236088c 100644 --- a/dev/Settings/App/SettingsSocial.js +++ b/dev/Settings/App/Social.js @@ -6,11 +6,11 @@ /** * @constructor */ - function SettingsSocial() + function SocialAppSetting() { var Utils = require('Common/Utils'), - Data = require('Storage:RainLoop:Data') + Data = require('Storage/App/Data') ; this.googleEnable = Data.googleEnable; @@ -34,43 +34,43 @@ this.connectGoogle = Utils.createCommand(this, function () { if (!this.googleLoggined()) { - require('App:RainLoop').googleConnect(); + require('App/App').googleConnect(); } }, function () { return !this.googleLoggined() && !this.googleActions(); }); this.disconnectGoogle = Utils.createCommand(this, function () { - require('App:RainLoop').googleDisconnect(); + require('App/App').googleDisconnect(); }); this.connectFacebook = Utils.createCommand(this, function () { if (!this.facebookLoggined()) { - require('App:RainLoop').facebookConnect(); + require('App/App').facebookConnect(); } }, function () { return !this.facebookLoggined() && !this.facebookActions(); }); this.disconnectFacebook = Utils.createCommand(this, function () { - require('App:RainLoop').facebookDisconnect(); + require('App/App').facebookDisconnect(); }); this.connectTwitter = Utils.createCommand(this, function () { if (!this.twitterLoggined()) { - require('App:RainLoop').twitterConnect(); + require('App/App').twitterConnect(); } }, function () { return !this.twitterLoggined() && !this.twitterActions(); }); this.disconnectTwitter = Utils.createCommand(this, function () { - require('App:RainLoop').twitterDisconnect(); + require('App/App').twitterDisconnect(); }); } - module.exports = SettingsSocial; + module.exports = SocialAppSetting; }()); \ No newline at end of file diff --git a/dev/Settings/App/SettingsThemes.js b/dev/Settings/App/Themes.js similarity index 93% rename from dev/Settings/App/SettingsThemes.js rename to dev/Settings/App/Themes.js index ab3880f42..a09875c67 100644 --- a/dev/Settings/App/SettingsThemes.js +++ b/dev/Settings/App/Themes.js @@ -13,14 +13,14 @@ Utils = require('Common/Utils'), LinkBuilder = require('Common/LinkBuilder'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote') + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote') ; /** * @constructor */ - function SettingsThemes() + function ThemesAppSetting() { var self = this; @@ -114,7 +114,7 @@ }, this); } - SettingsThemes.prototype.onBuild = function () + ThemesAppSetting.prototype.onBuild = function () { var sCurrentTheme = Data.theme(); this.themesObjects(_.map(Data.themes(), function (sTheme) { @@ -127,6 +127,6 @@ })); }; - module.exports = SettingsThemes; + module.exports = ThemesAppSetting; }()); \ No newline at end of file diff --git a/dev/Storages/AbstractData.js b/dev/Storage/AbstractData.js similarity index 94% rename from dev/Storages/AbstractData.js rename to dev/Storage/AbstractData.js index 84b2021a9..dd9fe8caa 100644 --- a/dev/Storages/AbstractData.js +++ b/dev/Storage/AbstractData.js @@ -8,18 +8,18 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Settings = require('Storage:Settings') + Settings = require('Storage/Settings') ; /** * @constructor */ - function AbstractData() + function AbstractDataStorate() { Utils.initDataConstructorBySettings(this); } - AbstractData.prototype.populateDataOnStart = function() + AbstractDataStorate.prototype.populateDataOnStart = function() { var mLayout = Utils.pInt(Settings.settingsGet('Layout')), @@ -88,6 +88,6 @@ this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed')); }; - module.exports = AbstractData; + module.exports = AbstractDataStorate; }()); \ No newline at end of file diff --git a/dev/Storages/AbstractRemoteStorage.js b/dev/Storage/AbstractRemote.js similarity index 99% rename from dev/Storages/AbstractRemoteStorage.js rename to dev/Storage/AbstractRemote.js index 0759e1743..a6c34d0cd 100644 --- a/dev/Storages/AbstractRemoteStorage.js +++ b/dev/Storage/AbstractRemote.js @@ -16,7 +16,7 @@ Plugins = require('Common/Plugins'), LinkBuilder = require('Common/LinkBuilder'), - Settings = require('Storage:Settings') + Settings = require('Storage/Settings') ; /** diff --git a/dev/Storages/AdminDataStorage.js b/dev/Storage/Admin/Data.js similarity index 87% rename from dev/Storages/AdminDataStorage.js rename to dev/Storage/Admin/Data.js index eb3d4602d..4c1789d3c 100644 --- a/dev/Storages/AdminDataStorage.js +++ b/dev/Storage/Admin/Data.js @@ -8,14 +8,14 @@ _ = require('_'), ko = require('ko'), - AbstractData = require('Storage:Abstract:Data') + AbstractData = require('Storage/AbstractData') ; /** * @constructor * @extends AbstractData */ - function AdminDataStorage() + function DataAdminStorage() { AbstractData.call(this); @@ -56,13 +56,13 @@ }, this).extend({'rateLimit': 300}); } - _.extend(AdminDataStorage.prototype, AbstractData.prototype); + _.extend(DataAdminStorage.prototype, AbstractData.prototype); - AdminDataStorage.prototype.populateDataOnStart = function() + DataAdminStorage.prototype.populateDataOnStart = function() { AbstractData.prototype.populateDataOnStart.call(this); }; - module.exports = new AdminDataStorage(); + module.exports = new DataAdminStorage(); }()); \ No newline at end of file diff --git a/dev/Storages/AdminRemoteStorage.js b/dev/Storage/Admin/Remote.js similarity index 73% rename from dev/Storages/AdminRemoteStorage.js rename to dev/Storage/Admin/Remote.js index 7851551a9..b4b4f219b 100644 --- a/dev/Storages/AdminRemoteStorage.js +++ b/dev/Storage/Admin/Remote.js @@ -1,34 +1,34 @@ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ (function () { - + 'use strict'; var _ = require('_'), - AbstractRemoteStorage = require('Storage:Abstract:Remote') + AbstractRemoteStorage = require('Storage/AbstractRemote') ; /** * @constructor * @extends AbstractRemoteStorage */ - function AdminRemoteStorage() + function RemoteAdminStorage() { AbstractRemoteStorage.call(this); this.oRequests = {}; } - _.extend(AdminRemoteStorage.prototype, AbstractRemoteStorage.prototype); + _.extend(RemoteAdminStorage.prototype, AbstractRemoteStorage.prototype); /** * @param {?Function} fCallback * @param {string} sLogin * @param {string} sPassword */ - AdminRemoteStorage.prototype.adminLogin = function (fCallback, sLogin, sPassword) + RemoteAdminStorage.prototype.adminLogin = function (fCallback, sLogin, sPassword) { this.defaultRequest(fCallback, 'AdminLogin', { 'Login': sLogin, @@ -39,7 +39,7 @@ /** * @param {?Function} fCallback */ - AdminRemoteStorage.prototype.adminLogout = function (fCallback) + RemoteAdminStorage.prototype.adminLogout = function (fCallback) { this.defaultRequest(fCallback, 'AdminLogout'); }; @@ -48,7 +48,7 @@ * @param {?Function} fCallback * @param {?} oData */ - AdminRemoteStorage.prototype.saveAdminConfig = function (fCallback, oData) + RemoteAdminStorage.prototype.saveAdminConfig = function (fCallback, oData) { this.defaultRequest(fCallback, 'AdminSettingsUpdate', oData); }; @@ -56,7 +56,7 @@ /** * @param {?Function} fCallback */ - AdminRemoteStorage.prototype.domainList = function (fCallback) + RemoteAdminStorage.prototype.domainList = function (fCallback) { this.defaultRequest(fCallback, 'AdminDomainList'); }; @@ -64,7 +64,7 @@ /** * @param {?Function} fCallback */ - AdminRemoteStorage.prototype.pluginList = function (fCallback) + RemoteAdminStorage.prototype.pluginList = function (fCallback) { this.defaultRequest(fCallback, 'AdminPluginList'); }; @@ -72,7 +72,7 @@ /** * @param {?Function} fCallback */ - AdminRemoteStorage.prototype.packagesList = function (fCallback) + RemoteAdminStorage.prototype.packagesList = function (fCallback) { this.defaultRequest(fCallback, 'AdminPackagesList'); }; @@ -80,7 +80,7 @@ /** * @param {?Function} fCallback */ - AdminRemoteStorage.prototype.coreData = function (fCallback) + RemoteAdminStorage.prototype.coreData = function (fCallback) { this.defaultRequest(fCallback, 'AdminCoreData'); }; @@ -88,7 +88,7 @@ /** * @param {?Function} fCallback */ - AdminRemoteStorage.prototype.updateCoreData = function (fCallback) + RemoteAdminStorage.prototype.updateCoreData = function (fCallback) { this.defaultRequest(fCallback, 'AdminUpdateCoreData', {}, 90000); }; @@ -97,7 +97,7 @@ * @param {?Function} fCallback * @param {Object} oPackage */ - AdminRemoteStorage.prototype.packageInstall = function (fCallback, oPackage) + RemoteAdminStorage.prototype.packageInstall = function (fCallback, oPackage) { this.defaultRequest(fCallback, 'AdminPackageInstall', { 'Id': oPackage.id, @@ -110,7 +110,7 @@ * @param {?Function} fCallback * @param {Object} oPackage */ - AdminRemoteStorage.prototype.packageDelete = function (fCallback, oPackage) + RemoteAdminStorage.prototype.packageDelete = function (fCallback, oPackage) { this.defaultRequest(fCallback, 'AdminPackageDelete', { 'Id': oPackage.id @@ -121,7 +121,7 @@ * @param {?Function} fCallback * @param {string} sName */ - AdminRemoteStorage.prototype.domain = function (fCallback, sName) + RemoteAdminStorage.prototype.domain = function (fCallback, sName) { this.defaultRequest(fCallback, 'AdminDomainLoad', { 'Name': sName @@ -132,7 +132,7 @@ * @param {?Function} fCallback * @param {string} sName */ - AdminRemoteStorage.prototype.plugin = function (fCallback, sName) + RemoteAdminStorage.prototype.plugin = function (fCallback, sName) { this.defaultRequest(fCallback, 'AdminPluginLoad', { 'Name': sName @@ -143,7 +143,7 @@ * @param {?Function} fCallback * @param {string} sName */ - AdminRemoteStorage.prototype.domainDelete = function (fCallback, sName) + RemoteAdminStorage.prototype.domainDelete = function (fCallback, sName) { this.defaultRequest(fCallback, 'AdminDomainDelete', { 'Name': sName @@ -155,7 +155,7 @@ * @param {string} sName * @param {boolean} bDisabled */ - AdminRemoteStorage.prototype.domainDisable = function (fCallback, sName, bDisabled) + RemoteAdminStorage.prototype.domainDisable = function (fCallback, sName, bDisabled) { return this.defaultRequest(fCallback, 'AdminDomainDisable', { 'Name': sName, @@ -167,7 +167,7 @@ * @param {?Function} fCallback * @param {Object} oConfig */ - AdminRemoteStorage.prototype.pluginSettingsUpdate = function (fCallback, oConfig) + RemoteAdminStorage.prototype.pluginSettingsUpdate = function (fCallback, oConfig) { return this.defaultRequest(fCallback, 'AdminPluginSettingsUpdate', oConfig); }; @@ -176,7 +176,7 @@ * @param {?Function} fCallback * @param {boolean} bForce */ - AdminRemoteStorage.prototype.licensing = function (fCallback, bForce) + RemoteAdminStorage.prototype.licensing = function (fCallback, bForce) { return this.defaultRequest(fCallback, 'AdminLicensing', { 'Force' : bForce ? '1' : '0' @@ -188,7 +188,7 @@ * @param {string} sDomain * @param {string} sKey */ - AdminRemoteStorage.prototype.licensingActivate = function (fCallback, sDomain, sKey) + RemoteAdminStorage.prototype.licensingActivate = function (fCallback, sDomain, sKey) { return this.defaultRequest(fCallback, 'AdminLicensingActivate', { 'Domain' : sDomain, @@ -201,7 +201,7 @@ * @param {string} sName * @param {boolean} bDisabled */ - AdminRemoteStorage.prototype.pluginDisable = function (fCallback, sName, bDisabled) + RemoteAdminStorage.prototype.pluginDisable = function (fCallback, sName, bDisabled) { return this.defaultRequest(fCallback, 'AdminPluginDisable', { 'Name': sName, @@ -209,7 +209,7 @@ }); }; - AdminRemoteStorage.prototype.createOrUpdateDomain = function (fCallback, + RemoteAdminStorage.prototype.createOrUpdateDomain = function (fCallback, bCreate, sName, sIncHost, iIncPort, sIncSecure, bIncShortLogin, sOutHost, iOutPort, sOutSecure, bOutShortLogin, bOutAuth, sWhiteList) { @@ -229,7 +229,7 @@ }); }; - AdminRemoteStorage.prototype.testConnectionForDomain = function (fCallback, sName, + RemoteAdminStorage.prototype.testConnectionForDomain = function (fCallback, sName, sIncHost, iIncPort, sIncSecure, sOutHost, iOutPort, sOutSecure, bOutAuth) { @@ -249,7 +249,7 @@ * @param {?Function} fCallback * @param {?} oData */ - AdminRemoteStorage.prototype.testContacts = function (fCallback, oData) + RemoteAdminStorage.prototype.testContacts = function (fCallback, oData) { this.defaultRequest(fCallback, 'AdminContactsTest', oData); }; @@ -258,7 +258,7 @@ * @param {?Function} fCallback * @param {?} oData */ - AdminRemoteStorage.prototype.saveNewAdminPassword = function (fCallback, oData) + RemoteAdminStorage.prototype.saveNewAdminPassword = function (fCallback, oData) { this.defaultRequest(fCallback, 'AdminPasswordUpdate', oData); }; @@ -266,11 +266,11 @@ /** * @param {?Function} fCallback */ - AdminRemoteStorage.prototype.adminPing = function (fCallback) + RemoteAdminStorage.prototype.adminPing = function (fCallback) { this.defaultRequest(fCallback, 'AdminPing'); }; - module.exports = new AdminRemoteStorage(); + module.exports = new RemoteAdminStorage(); }()); \ No newline at end of file diff --git a/dev/Storages/CacheStorage.js b/dev/Storage/App/Cache.js similarity index 71% rename from dev/Storages/CacheStorage.js rename to dev/Storage/App/Cache.js index 0f52a618f..7c4671c1e 100644 --- a/dev/Storages/CacheStorage.js +++ b/dev/Storage/App/Cache.js @@ -11,13 +11,13 @@ Utils = require('Common/Utils'), LinkBuilder = require('Common/LinkBuilder'), - Settings = require('Storage:Settings') + Settings = require('Storage/Settings') ; /** * @constructor */ - function CacheStorage() + function CacheAppStorage() { this.oFoldersCache = {}; this.oFoldersNamesCache = {}; @@ -34,54 +34,54 @@ /** * @type {boolean} */ - CacheStorage.prototype.bCapaGravatar = false; + CacheAppStorage.prototype.bCapaGravatar = false; /** * @type {Object} */ - CacheStorage.prototype.oFoldersCache = {}; + CacheAppStorage.prototype.oFoldersCache = {}; /** * @type {Object} */ - CacheStorage.prototype.oFoldersNamesCache = {}; + CacheAppStorage.prototype.oFoldersNamesCache = {}; /** * @type {Object} */ - CacheStorage.prototype.oFolderHashCache = {}; + CacheAppStorage.prototype.oFolderHashCache = {}; /** * @type {Object} */ - CacheStorage.prototype.oFolderUidNextCache = {}; + CacheAppStorage.prototype.oFolderUidNextCache = {}; /** * @type {Object} */ - CacheStorage.prototype.oMessageListHashCache = {}; + CacheAppStorage.prototype.oMessageListHashCache = {}; /** * @type {Object} */ - CacheStorage.prototype.oMessageFlagsCache = {}; + CacheAppStorage.prototype.oMessageFlagsCache = {}; /** * @type {Object} */ - CacheStorage.prototype.oBodies = {}; + CacheAppStorage.prototype.oBodies = {}; /** * @type {Object} */ - CacheStorage.prototype.oNewMessage = {}; + CacheAppStorage.prototype.oNewMessage = {}; /** * @type {Object} */ - CacheStorage.prototype.oRequestedMessage = {}; + CacheAppStorage.prototype.oRequestedMessage = {}; - CacheStorage.prototype.clear = function () + CacheAppStorage.prototype.clear = function () { this.oFoldersCache = {}; this.oFoldersNamesCache = {}; @@ -98,7 +98,7 @@ * @param {Function} fCallback * @return {string} */ - CacheStorage.prototype.getUserPic = function (sEmail, fCallback) + CacheAppStorage.prototype.getUserPic = function (sEmail, fCallback) { sEmail = Utils.trim(sEmail); fCallback(this.bCapaGravatar && '' !== sEmail ? LinkBuilder.avatarLink(sEmail) : '', sEmail); @@ -109,7 +109,7 @@ * @param {string} sUid * @return {string} */ - CacheStorage.prototype.getMessageKey = function (sFolderFullNameRaw, sUid) + CacheAppStorage.prototype.getMessageKey = function (sFolderFullNameRaw, sUid) { return sFolderFullNameRaw + '#' + sUid; }; @@ -118,7 +118,7 @@ * @param {string} sFolder * @param {string} sUid */ - CacheStorage.prototype.addRequestedMessage = function (sFolder, sUid) + CacheAppStorage.prototype.addRequestedMessage = function (sFolder, sUid) { this.oRequestedMessage[this.getMessageKey(sFolder, sUid)] = true; }; @@ -128,7 +128,7 @@ * @param {string} sUid * @return {boolean} */ - CacheStorage.prototype.hasRequestedMessage = function (sFolder, sUid) + CacheAppStorage.prototype.hasRequestedMessage = function (sFolder, sUid) { return true === this.oRequestedMessage[this.getMessageKey(sFolder, sUid)]; }; @@ -137,7 +137,7 @@ * @param {string} sFolderFullNameRaw * @param {string} sUid */ - CacheStorage.prototype.addNewMessageCache = function (sFolderFullNameRaw, sUid) + CacheAppStorage.prototype.addNewMessageCache = function (sFolderFullNameRaw, sUid) { this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)] = true; }; @@ -146,7 +146,7 @@ * @param {string} sFolderFullNameRaw * @param {string} sUid */ - CacheStorage.prototype.hasNewMessageAndRemoveFromCache = function (sFolderFullNameRaw, sUid) + CacheAppStorage.prototype.hasNewMessageAndRemoveFromCache = function (sFolderFullNameRaw, sUid) { if (this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)]) { @@ -157,7 +157,7 @@ return false; }; - CacheStorage.prototype.clearNewMessageCache = function () + CacheAppStorage.prototype.clearNewMessageCache = function () { this.oNewMessage = {}; }; @@ -166,7 +166,7 @@ * @param {string} sFolderHash * @return {string} */ - CacheStorage.prototype.getFolderFullNameRaw = function (sFolderHash) + CacheAppStorage.prototype.getFolderFullNameRaw = function (sFolderHash) { return '' !== sFolderHash && this.oFoldersNamesCache[sFolderHash] ? this.oFoldersNamesCache[sFolderHash] : ''; }; @@ -175,7 +175,7 @@ * @param {string} sFolderHash * @param {string} sFolderFullNameRaw */ - CacheStorage.prototype.setFolderFullNameRaw = function (sFolderHash, sFolderFullNameRaw) + CacheAppStorage.prototype.setFolderFullNameRaw = function (sFolderHash, sFolderFullNameRaw) { this.oFoldersNamesCache[sFolderHash] = sFolderFullNameRaw; }; @@ -184,7 +184,7 @@ * @param {string} sFolderFullNameRaw * @return {string} */ - CacheStorage.prototype.getFolderHash = function (sFolderFullNameRaw) + CacheAppStorage.prototype.getFolderHash = function (sFolderFullNameRaw) { return '' !== sFolderFullNameRaw && this.oFolderHashCache[sFolderFullNameRaw] ? this.oFolderHashCache[sFolderFullNameRaw] : ''; }; @@ -193,7 +193,7 @@ * @param {string} sFolderFullNameRaw * @param {string} sFolderHash */ - CacheStorage.prototype.setFolderHash = function (sFolderFullNameRaw, sFolderHash) + CacheAppStorage.prototype.setFolderHash = function (sFolderFullNameRaw, sFolderHash) { this.oFolderHashCache[sFolderFullNameRaw] = sFolderHash; }; @@ -202,7 +202,7 @@ * @param {string} sFolderFullNameRaw * @return {string} */ - CacheStorage.prototype.getFolderUidNext = function (sFolderFullNameRaw) + CacheAppStorage.prototype.getFolderUidNext = function (sFolderFullNameRaw) { return '' !== sFolderFullNameRaw && this.oFolderUidNextCache[sFolderFullNameRaw] ? this.oFolderUidNextCache[sFolderFullNameRaw] : ''; }; @@ -211,7 +211,7 @@ * @param {string} sFolderFullNameRaw * @param {string} sUidNext */ - CacheStorage.prototype.setFolderUidNext = function (sFolderFullNameRaw, sUidNext) + CacheAppStorage.prototype.setFolderUidNext = function (sFolderFullNameRaw, sUidNext) { this.oFolderUidNextCache[sFolderFullNameRaw] = sUidNext; }; @@ -220,7 +220,7 @@ * @param {string} sFolderFullNameRaw * @return {?FolderModel} */ - CacheStorage.prototype.getFolderFromCacheList = function (sFolderFullNameRaw) + CacheAppStorage.prototype.getFolderFromCacheList = function (sFolderFullNameRaw) { return '' !== sFolderFullNameRaw && this.oFoldersCache[sFolderFullNameRaw] ? this.oFoldersCache[sFolderFullNameRaw] : null; }; @@ -229,7 +229,7 @@ * @param {string} sFolderFullNameRaw * @param {?FolderModel} oFolder */ - CacheStorage.prototype.setFolderToCacheList = function (sFolderFullNameRaw, oFolder) + CacheAppStorage.prototype.setFolderToCacheList = function (sFolderFullNameRaw, oFolder) { this.oFoldersCache[sFolderFullNameRaw] = oFolder; }; @@ -237,7 +237,7 @@ /** * @param {string} sFolderFullNameRaw */ - CacheStorage.prototype.removeFolderFromCacheList = function (sFolderFullNameRaw) + CacheAppStorage.prototype.removeFolderFromCacheList = function (sFolderFullNameRaw) { this.setFolderToCacheList(sFolderFullNameRaw, null); }; @@ -247,7 +247,7 @@ * @param {string} sUid * @return {?Array} */ - CacheStorage.prototype.getMessageFlagsFromCache = function (sFolderFullName, sUid) + CacheAppStorage.prototype.getMessageFlagsFromCache = function (sFolderFullName, sUid) { return this.oMessageFlagsCache[sFolderFullName] && this.oMessageFlagsCache[sFolderFullName][sUid] ? this.oMessageFlagsCache[sFolderFullName][sUid] : null; @@ -258,7 +258,7 @@ * @param {string} sUid * @param {Array} aFlagsCache */ - CacheStorage.prototype.setMessageFlagsToCache = function (sFolderFullName, sUid, aFlagsCache) + CacheAppStorage.prototype.setMessageFlagsToCache = function (sFolderFullName, sUid, aFlagsCache) { if (!this.oMessageFlagsCache[sFolderFullName]) { @@ -271,7 +271,7 @@ /** * @param {string} sFolderFullName */ - CacheStorage.prototype.clearMessageFlagsFromCacheByFolder = function (sFolderFullName) + CacheAppStorage.prototype.clearMessageFlagsFromCacheByFolder = function (sFolderFullName) { this.oMessageFlagsCache[sFolderFullName] = {}; }; @@ -279,7 +279,7 @@ /** * @param {(MessageModel|null)} oMessage */ - CacheStorage.prototype.initMessageFlagsFromCache = function (oMessage) + CacheAppStorage.prototype.initMessageFlagsFromCache = function (oMessage) { if (oMessage) { @@ -320,7 +320,7 @@ /** * @param {(MessageModel|null)} oMessage */ - CacheStorage.prototype.storeMessageFlagsToCache = function (oMessage) + CacheAppStorage.prototype.storeMessageFlagsToCache = function (oMessage) { if (oMessage) { @@ -336,7 +336,7 @@ * @param {string} sUid * @param {Array} aFlags */ - CacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function (sFolder, sUid, aFlags) + CacheAppStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function (sFolder, sUid, aFlags) { if (Utils.isArray(aFlags) && 0 < aFlags.length) { @@ -344,6 +344,6 @@ } }; - module.exports = new CacheStorage(); + module.exports = new CacheAppStorage(); }()); \ No newline at end of file diff --git a/dev/Storages/DataStorage.js b/dev/Storage/App/Data.js similarity index 95% rename from dev/Storages/DataStorage.js rename to dev/Storage/App/Data.js index 8aa50ed28..90b660a9e 100644 --- a/dev/Storages/DataStorage.js +++ b/dev/Storage/App/Data.js @@ -17,22 +17,22 @@ Utils = require('Common/Utils'), LinkBuilder = require('Common/LinkBuilder'), - Settings = require('Storage:Settings'), - Cache = require('Storage:RainLoop:Cache'), + Settings = require('Storage/Settings'), + Cache = require('Storage/App/Cache'), - kn = require('App:Knoin'), + kn = require('Knoin/Knoin'), MessageModel = require('Model/Message'), - LocalStorage = require('Storage:LocalStorage'), - AbstractData = require('Storage:Abstract:Data') + Local = require('Storage/Local'), + AbstractData = require('Storage/AbstractData') ; /** * @constructor * @extends AbstractData */ - function DataStorage() + function DataAppStorage() { AbstractData.call(this); @@ -323,7 +323,7 @@ if (Enums.Layout.NoPreview === this.layout() && -1 < window.location.hash.indexOf('message-preview')) { - require('App:RainLoop').historyBack(); + require('App/App').historyBack(); } } else if (Enums.Layout.NoPreview === this.layout()) @@ -471,9 +471,9 @@ this.purgeMessageBodyCacheThrottle = _.throttle(this.purgeMessageBodyCache, 1000 * 30); } - _.extend(DataStorage.prototype, AbstractData.prototype); + _.extend(DataAppStorage.prototype, AbstractData.prototype); - DataStorage.prototype.purgeMessageBodyCache = function() + DataAppStorage.prototype.purgeMessageBodyCache = function() { var iCount = 0, @@ -505,7 +505,7 @@ } }; - DataStorage.prototype.populateDataOnStart = function() + DataAppStorage.prototype.populateDataOnStart = function() { AbstractData.prototype.populateDataOnStart.call(this); @@ -522,7 +522,7 @@ this.signatureToAll(!!Settings.settingsGet('SignatureToAll')); this.enableTwoFactor(!!Settings.settingsGet('EnableTwoFactor')); - this.lastFoldersHash = LocalStorage.get(Enums.ClientSideKeyName.FoldersLashHash) || ''; + this.lastFoldersHash = Local.get(Enums.ClientSideKeyName.FoldersLashHash) || ''; this.remoteSuggestions = !!Settings.settingsGet('RemoteSuggestions'); @@ -530,7 +530,7 @@ this.devPassword = Settings.settingsGet('DevPassword'); }; - DataStorage.prototype.initUidNextAndNewMessages = function (sFolder, sUidNext, aNewMessages) + DataAppStorage.prototype.initUidNextAndNewMessages = function (sFolder, sUidNext, aNewMessages) { if ('INBOX' === sFolder && Utils.isNormal(sUidNext) && sUidNext !== '') { @@ -609,7 +609,7 @@ } }; - DataStorage.prototype.hideMessageBodies = function () + DataAppStorage.prototype.hideMessageBodies = function () { var oMessagesBodiesDom = this.messagesBodiesDom(); if (oMessagesBodiesDom) @@ -622,7 +622,7 @@ * @param {boolean=} bBoot = false * @returns {Array} */ - DataStorage.prototype.getNextFolderNames = function (bBoot) + DataAppStorage.prototype.getNextFolderNames = function (bBoot) { bBoot = Utils.isUnd(bBoot) ? false : !!bBoot; @@ -685,7 +685,7 @@ * @param {string=} sToFolderFullNameRaw = '' * @param {bCopy=} bCopy = false */ - DataStorage.prototype.removeMessagesFromList = function ( + DataAppStorage.prototype.removeMessagesFromList = function ( sFromFolderFullNameRaw, aUidForRemove, sToFolderFullNameRaw, bCopy) { sToFolderFullNameRaw = Utils.isNormal(sToFolderFullNameRaw) ? sToFolderFullNameRaw : ''; @@ -782,7 +782,7 @@ /** * @param {Object} oMessageTextBody */ - DataStorage.prototype.initBlockquoteSwitcher = function (oMessageTextBody) + DataAppStorage.prototype.initBlockquoteSwitcher = function (oMessageTextBody) { if (oMessageTextBody) { @@ -814,10 +814,9 @@ } }; - DataStorage.prototype.setMessage = function (oData, bCached) + DataAppStorage.prototype.setMessage = function (oData, bCached) { var - self = this, bIsHtml = false, bHasExternals = false, bHasInternals = false, @@ -961,7 +960,7 @@ Cache.initMessageFlagsFromCache(oMessage); if (oMessage.unseen()) { - require('App:RainLoop').setMessageSeen(oMessage); + require('App/App').setMessageSeen(oMessage); } Utils.windowResize(); @@ -972,21 +971,21 @@ * @param {Array} aList * @returns {string} */ - DataStorage.prototype.calculateMessageListHash = function (aList) + DataAppStorage.prototype.calculateMessageListHash = function (aList) { return _.map(aList, function (oMessage) { return '' + oMessage.hash + '_' + oMessage.threadsLen() + '_' + oMessage.flagHash(); }).join('|'); }; - DataStorage.prototype.findPublicKeyByHex = function (sHash) + DataAppStorage.prototype.findPublicKeyByHex = function (sHash) { return _.find(this.openpgpkeysPublic(), function (oItem) { return oItem && sHash === oItem.id; }); }; - DataStorage.prototype.findPublicKeysByEmail = function (sEmail) + DataAppStorage.prototype.findPublicKeysByEmail = function (sEmail) { var self = this; return _.compact(_.map(this.openpgpkeysPublic(), function (oItem) { @@ -1015,7 +1014,7 @@ * @param {string=} sPassword * @returns {?} */ - DataStorage.prototype.findPrivateKeyByEmail = function (sEmail, sPassword) + DataAppStorage.prototype.findPrivateKeyByEmail = function (sEmail, sPassword) { var self = this, @@ -1053,11 +1052,11 @@ * @param {string=} sPassword * @returns {?} */ - DataStorage.prototype.findSelfPrivateKey = function (sPassword) + DataAppStorage.prototype.findSelfPrivateKey = function (sPassword) { return this.findPrivateKeyByEmail(this.accountEmail(), sPassword); }; - module.exports = new DataStorage(); + module.exports = new DataAppStorage(); }()); diff --git a/dev/Storages/RemoteStorage.js b/dev/Storage/App/Remote.js similarity index 76% rename from dev/Storages/RemoteStorage.js rename to dev/Storage/App/Remote.js index 333cf400e..92be01fea 100644 --- a/dev/Storages/RemoteStorage.js +++ b/dev/Storage/App/Remote.js @@ -9,33 +9,32 @@ Utils = require('Common/Utils'), Consts = require('Common/Consts'), - Globals = require('Common/Globals'), Base64 = require('Common/Base64'), - Settings = require('Storage:Settings'), - Cache = require('Storage:RainLoop:Cache'), - Data = require('Storage:RainLoop:Data'), + Settings = require('Storage/Settings'), + Cache = require('Storage/App/Cache'), + Data = require('Storage/App/Data'), - AbstractRemoteStorage = require('Storage:Abstract:Remote') + AbstractRemoteStorage = require('Storage/AbstractRemote') ; /** * @constructor * @extends AbstractRemoteStorage */ - function RemoteStorage() + function RemoteAppStorage() { AbstractRemoteStorage.call(this); this.oRequests = {}; } - _.extend(RemoteStorage.prototype, AbstractRemoteStorage.prototype); + _.extend(RemoteAppStorage.prototype, AbstractRemoteStorage.prototype); /** * @param {?Function} fCallback */ - RemoteStorage.prototype.folders = function (fCallback) + RemoteAppStorage.prototype.folders = function (fCallback) { this.defaultRequest(fCallback, 'Folders', { 'SentFolder': Settings.settingsGet('SentFolder'), @@ -56,7 +55,7 @@ * @param {string=} sAdditionalCode * @param {boolean=} bAdditionalCodeSignMe */ - RemoteStorage.prototype.login = function (fCallback, sEmail, sLogin, sPassword, bSignMe, sLanguage, sAdditionalCode, bAdditionalCodeSignMe) + RemoteAppStorage.prototype.login = function (fCallback, sEmail, sLogin, sPassword, bSignMe, sLanguage, sAdditionalCode, bAdditionalCodeSignMe) { this.defaultRequest(fCallback, 'Login', { 'Email': sEmail, @@ -72,7 +71,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.getTwoFactor = function (fCallback) + RemoteAppStorage.prototype.getTwoFactor = function (fCallback) { this.defaultRequest(fCallback, 'GetTwoFactorInfo'); }; @@ -80,7 +79,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.createTwoFactor = function (fCallback) + RemoteAppStorage.prototype.createTwoFactor = function (fCallback) { this.defaultRequest(fCallback, 'CreateTwoFactorSecret'); }; @@ -88,7 +87,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.clearTwoFactor = function (fCallback) + RemoteAppStorage.prototype.clearTwoFactor = function (fCallback) { this.defaultRequest(fCallback, 'ClearTwoFactorInfo'); }; @@ -96,7 +95,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.showTwoFactorSecret = function (fCallback) + RemoteAppStorage.prototype.showTwoFactorSecret = function (fCallback) { this.defaultRequest(fCallback, 'ShowTwoFactorSecret'); }; @@ -105,7 +104,7 @@ * @param {?Function} fCallback * @param {string} sCode */ - RemoteStorage.prototype.testTwoFactor = function (fCallback, sCode) + RemoteAppStorage.prototype.testTwoFactor = function (fCallback, sCode) { this.defaultRequest(fCallback, 'TestTwoFactorInfo', { 'Code': sCode @@ -116,7 +115,7 @@ * @param {?Function} fCallback * @param {boolean} bEnable */ - RemoteStorage.prototype.enableTwoFactor = function (fCallback, bEnable) + RemoteAppStorage.prototype.enableTwoFactor = function (fCallback, bEnable) { this.defaultRequest(fCallback, 'EnableTwoFactor', { 'Enable': bEnable ? '1' : '0' @@ -126,7 +125,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.clearTwoFactorInfo = function (fCallback) + RemoteAppStorage.prototype.clearTwoFactorInfo = function (fCallback) { this.defaultRequest(fCallback, 'ClearTwoFactorInfo'); }; @@ -134,7 +133,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.contactsSync = function (fCallback) + RemoteAppStorage.prototype.contactsSync = function (fCallback) { this.defaultRequest(fCallback, 'ContactsSync', null, Consts.Defaults.ContactsSyncAjaxTimeout); }; @@ -146,7 +145,7 @@ * @param {string} sUser * @param {string} sPassword */ - RemoteStorage.prototype.saveContactsSyncData = function (fCallback, bEnable, sUrl, sUser, sPassword) + RemoteAppStorage.prototype.saveContactsSyncData = function (fCallback, bEnable, sUrl, sUser, sPassword) { this.defaultRequest(fCallback, 'SaveContactsSyncData', { 'Enable': bEnable ? '1' : '0', @@ -162,7 +161,7 @@ * @param {string} sLogin * @param {string} sPassword */ - RemoteStorage.prototype.accountAdd = function (fCallback, sEmail, sLogin, sPassword) + RemoteAppStorage.prototype.accountAdd = function (fCallback, sEmail, sLogin, sPassword) { this.defaultRequest(fCallback, 'AccountAdd', { 'Email': sEmail, @@ -175,7 +174,7 @@ * @param {?Function} fCallback * @param {string} sEmailToDelete */ - RemoteStorage.prototype.accountDelete = function (fCallback, sEmailToDelete) + RemoteAppStorage.prototype.accountDelete = function (fCallback, sEmailToDelete) { this.defaultRequest(fCallback, 'AccountDelete', { 'EmailToDelete': sEmailToDelete @@ -190,7 +189,7 @@ * @param {string} sReplyTo * @param {string} sBcc */ - RemoteStorage.prototype.identityUpdate = function (fCallback, sId, sEmail, sName, sReplyTo, sBcc) + RemoteAppStorage.prototype.identityUpdate = function (fCallback, sId, sEmail, sName, sReplyTo, sBcc) { this.defaultRequest(fCallback, 'IdentityUpdate', { 'Id': sId, @@ -205,7 +204,7 @@ * @param {?Function} fCallback * @param {string} sIdToDelete */ - RemoteStorage.prototype.identityDelete = function (fCallback, sIdToDelete) + RemoteAppStorage.prototype.identityDelete = function (fCallback, sIdToDelete) { this.defaultRequest(fCallback, 'IdentityDelete', { 'IdToDelete': sIdToDelete @@ -215,7 +214,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.accountsAndIdentities = function (fCallback) + RemoteAppStorage.prototype.accountsAndIdentities = function (fCallback) { this.defaultRequest(fCallback, 'AccountsAndIdentities'); }; @@ -228,7 +227,7 @@ * @param {string=} sSearch = '' * @param {boolean=} bSilent = false */ - RemoteStorage.prototype.messageList = function (fCallback, sFolderFullNameRaw, iOffset, iLimit, sSearch, bSilent) + RemoteAppStorage.prototype.messageList = function (fCallback, sFolderFullNameRaw, iOffset, iLimit, sSearch, bSilent) { sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw); @@ -275,7 +274,7 @@ * @param {?Function} fCallback * @param {Array} aDownloads */ - RemoteStorage.prototype.messageUploadAttachments = function (fCallback, aDownloads) + RemoteAppStorage.prototype.messageUploadAttachments = function (fCallback, aDownloads) { this.defaultRequest(fCallback, 'MessageUploadAttachments', { 'Attachments': aDownloads @@ -288,7 +287,7 @@ * @param {number} iUid * @return {boolean} */ - RemoteStorage.prototype.message = function (fCallback, sFolderFullNameRaw, iUid) + RemoteAppStorage.prototype.message = function (fCallback, sFolderFullNameRaw, iUid) { sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw); iUid = Utils.pInt(iUid); @@ -313,7 +312,7 @@ * @param {?Function} fCallback * @param {Array} aExternals */ - RemoteStorage.prototype.composeUploadExternals = function (fCallback, aExternals) + RemoteAppStorage.prototype.composeUploadExternals = function (fCallback, aExternals) { this.defaultRequest(fCallback, 'ComposeUploadExternals', { 'Externals': aExternals @@ -325,7 +324,7 @@ * @param {string} sUrl * @param {string} sAccessToken */ - RemoteStorage.prototype.composeUploadDrive = function (fCallback, sUrl, sAccessToken) + RemoteAppStorage.prototype.composeUploadDrive = function (fCallback, sUrl, sAccessToken) { this.defaultRequest(fCallback, 'ComposeUploadDrive', { 'AccessToken': sAccessToken, @@ -338,7 +337,7 @@ * @param {string} sFolder * @param {Array=} aList = [] */ - RemoteStorage.prototype.folderInformation = function (fCallback, sFolder, aList) + RemoteAppStorage.prototype.folderInformation = function (fCallback, sFolder, aList) { var bRequest = true, @@ -381,7 +380,7 @@ } else if (Data.useThreads()) { - require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache(); + require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache(); } }; @@ -389,7 +388,7 @@ * @param {?Function} fCallback * @param {Array} aFolders */ - RemoteStorage.prototype.folderInformationMultiply = function (fCallback, aFolders) + RemoteAppStorage.prototype.folderInformationMultiply = function (fCallback, aFolders) { this.defaultRequest(fCallback, 'FolderInformationMultiply', { 'Folders': aFolders @@ -399,7 +398,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.logout = function (fCallback) + RemoteAppStorage.prototype.logout = function (fCallback) { this.defaultRequest(fCallback, 'Logout'); }; @@ -410,7 +409,7 @@ * @param {Array} aUids * @param {boolean} bSetFlagged */ - RemoteStorage.prototype.messageSetFlagged = function (fCallback, sFolderFullNameRaw, aUids, bSetFlagged) + RemoteAppStorage.prototype.messageSetFlagged = function (fCallback, sFolderFullNameRaw, aUids, bSetFlagged) { this.defaultRequest(fCallback, 'MessageSetFlagged', { 'Folder': sFolderFullNameRaw, @@ -425,7 +424,7 @@ * @param {Array} aUids * @param {boolean} bSetSeen */ - RemoteStorage.prototype.messageSetSeen = function (fCallback, sFolderFullNameRaw, aUids, bSetSeen) + RemoteAppStorage.prototype.messageSetSeen = function (fCallback, sFolderFullNameRaw, aUids, bSetSeen) { this.defaultRequest(fCallback, 'MessageSetSeen', { 'Folder': sFolderFullNameRaw, @@ -439,7 +438,7 @@ * @param {string} sFolderFullNameRaw * @param {boolean} bSetSeen */ - RemoteStorage.prototype.messageSetSeenToAll = function (fCallback, sFolderFullNameRaw, bSetSeen) + RemoteAppStorage.prototype.messageSetSeenToAll = function (fCallback, sFolderFullNameRaw, bSetSeen) { this.defaultRequest(fCallback, 'MessageSetSeenToAll', { 'Folder': sFolderFullNameRaw, @@ -464,7 +463,7 @@ * @param {string} sInReplyTo * @param {string} sReferences */ - RemoteStorage.prototype.saveMessage = function (fCallback, sMessageFolder, sMessageUid, sDraftFolder, + RemoteAppStorage.prototype.saveMessage = function (fCallback, sMessageFolder, sMessageUid, sDraftFolder, sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences) { this.defaultRequest(fCallback, 'SaveMessage', { @@ -494,7 +493,7 @@ * @param {string} sSubject * @param {string} sText */ - RemoteStorage.prototype.sendReadReceiptMessage = function (fCallback, sMessageFolder, sMessageUid, sReadReceipt, sSubject, sText) + RemoteAppStorage.prototype.sendReadReceiptMessage = function (fCallback, sMessageFolder, sMessageUid, sReadReceipt, sSubject, sText) { this.defaultRequest(fCallback, 'SendReadReceiptMessage', { 'MessageFolder': sMessageFolder, @@ -523,7 +522,7 @@ * @param {string} sReferences * @param {boolean} bRequestReadReceipt */ - RemoteStorage.prototype.sendMessage = function (fCallback, sMessageFolder, sMessageUid, sSentFolder, + RemoteAppStorage.prototype.sendMessage = function (fCallback, sMessageFolder, sMessageUid, sSentFolder, sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences, bRequestReadReceipt) { this.defaultRequest(fCallback, 'SendMessage', { @@ -549,7 +548,7 @@ * @param {?Function} fCallback * @param {Object} oData */ - RemoteStorage.prototype.saveSystemFolders = function (fCallback, oData) + RemoteAppStorage.prototype.saveSystemFolders = function (fCallback, oData) { this.defaultRequest(fCallback, 'SystemFoldersUpdate', oData); }; @@ -558,7 +557,7 @@ * @param {?Function} fCallback * @param {Object} oData */ - RemoteStorage.prototype.saveSettings = function (fCallback, oData) + RemoteAppStorage.prototype.saveSettings = function (fCallback, oData) { this.defaultRequest(fCallback, 'SettingsUpdate', oData); }; @@ -568,7 +567,7 @@ * @param {string} sPrevPassword * @param {string} sNewPassword */ - RemoteStorage.prototype.changePassword = function (fCallback, sPrevPassword, sNewPassword) + RemoteAppStorage.prototype.changePassword = function (fCallback, sPrevPassword, sNewPassword) { this.defaultRequest(fCallback, 'ChangePassword', { 'PrevPassword': sPrevPassword, @@ -581,7 +580,7 @@ * @param {string} sNewFolderName * @param {string} sParentName */ - RemoteStorage.prototype.folderCreate = function (fCallback, sNewFolderName, sParentName) + RemoteAppStorage.prototype.folderCreate = function (fCallback, sNewFolderName, sParentName) { this.defaultRequest(fCallback, 'FolderCreate', { 'Folder': sNewFolderName, @@ -593,7 +592,7 @@ * @param {?Function} fCallback * @param {string} sFolderFullNameRaw */ - RemoteStorage.prototype.folderDelete = function (fCallback, sFolderFullNameRaw) + RemoteAppStorage.prototype.folderDelete = function (fCallback, sFolderFullNameRaw) { this.defaultRequest(fCallback, 'FolderDelete', { 'Folder': sFolderFullNameRaw @@ -605,7 +604,7 @@ * @param {string} sPrevFolderFullNameRaw * @param {string} sNewFolderName */ - RemoteStorage.prototype.folderRename = function (fCallback, sPrevFolderFullNameRaw, sNewFolderName) + RemoteAppStorage.prototype.folderRename = function (fCallback, sPrevFolderFullNameRaw, sNewFolderName) { this.defaultRequest(fCallback, 'FolderRename', { 'Folder': sPrevFolderFullNameRaw, @@ -617,7 +616,7 @@ * @param {?Function} fCallback * @param {string} sFolderFullNameRaw */ - RemoteStorage.prototype.folderClear = function (fCallback, sFolderFullNameRaw) + RemoteAppStorage.prototype.folderClear = function (fCallback, sFolderFullNameRaw) { this.defaultRequest(fCallback, 'FolderClear', { 'Folder': sFolderFullNameRaw @@ -629,7 +628,7 @@ * @param {string} sFolderFullNameRaw * @param {boolean} bSubscribe */ - RemoteStorage.prototype.folderSetSubscribe = function (fCallback, sFolderFullNameRaw, bSubscribe) + RemoteAppStorage.prototype.folderSetSubscribe = function (fCallback, sFolderFullNameRaw, bSubscribe) { this.defaultRequest(fCallback, 'FolderSubscribe', { 'Folder': sFolderFullNameRaw, @@ -644,7 +643,7 @@ * @param {Array} aUids * @param {string=} sLearning */ - RemoteStorage.prototype.messagesMove = function (fCallback, sFolder, sToFolder, aUids, sLearning) + RemoteAppStorage.prototype.messagesMove = function (fCallback, sFolder, sToFolder, aUids, sLearning) { this.defaultRequest(fCallback, 'MessageMove', { 'FromFolder': sFolder, @@ -660,7 +659,7 @@ * @param {string} sToFolder * @param {Array} aUids */ - RemoteStorage.prototype.messagesCopy = function (fCallback, sFolder, sToFolder, aUids) + RemoteAppStorage.prototype.messagesCopy = function (fCallback, sFolder, sToFolder, aUids) { this.defaultRequest(fCallback, 'MessageCopy', { 'FromFolder': sFolder, @@ -674,7 +673,7 @@ * @param {string} sFolder * @param {Array} aUids */ - RemoteStorage.prototype.messagesDelete = function (fCallback, sFolder, aUids) + RemoteAppStorage.prototype.messagesDelete = function (fCallback, sFolder, aUids) { this.defaultRequest(fCallback, 'MessageDelete', { 'Folder': sFolder, @@ -685,7 +684,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.appDelayStart = function (fCallback) + RemoteAppStorage.prototype.appDelayStart = function (fCallback) { this.defaultRequest(fCallback, 'AppDelayStart'); }; @@ -693,7 +692,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.quota = function (fCallback) + RemoteAppStorage.prototype.quota = function (fCallback) { this.defaultRequest(fCallback, 'Quota'); }; @@ -704,7 +703,7 @@ * @param {number} iLimit * @param {string} sSearch */ - RemoteStorage.prototype.contacts = function (fCallback, iOffset, iLimit, sSearch) + RemoteAppStorage.prototype.contacts = function (fCallback, iOffset, iLimit, sSearch) { this.defaultRequest(fCallback, 'Contacts', { 'Offset': iOffset, @@ -716,7 +715,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.contactSave = function (fCallback, sRequestUid, sUid, sTags, aProperties) + RemoteAppStorage.prototype.contactSave = function (fCallback, sRequestUid, sUid, sTags, aProperties) { this.defaultRequest(fCallback, 'ContactSave', { 'RequestUid': sRequestUid, @@ -730,7 +729,7 @@ * @param {?Function} fCallback * @param {Array} aUids */ - RemoteStorage.prototype.contactsDelete = function (fCallback, aUids) + RemoteAppStorage.prototype.contactsDelete = function (fCallback, aUids) { this.defaultRequest(fCallback, 'ContactsDelete', { 'Uids': aUids.join(',') @@ -742,7 +741,7 @@ * @param {string} sQuery * @param {number} iPage */ - RemoteStorage.prototype.suggestions = function (fCallback, sQuery, iPage) + RemoteAppStorage.prototype.suggestions = function (fCallback, sQuery, iPage) { this.defaultRequest(fCallback, 'Suggestions', { 'Query': sQuery, @@ -753,7 +752,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.facebookUser = function (fCallback) + RemoteAppStorage.prototype.facebookUser = function (fCallback) { this.defaultRequest(fCallback, 'SocialFacebookUserInformation'); }; @@ -761,7 +760,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.facebookDisconnect = function (fCallback) + RemoteAppStorage.prototype.facebookDisconnect = function (fCallback) { this.defaultRequest(fCallback, 'SocialFacebookDisconnect'); }; @@ -769,7 +768,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.twitterUser = function (fCallback) + RemoteAppStorage.prototype.twitterUser = function (fCallback) { this.defaultRequest(fCallback, 'SocialTwitterUserInformation'); }; @@ -777,7 +776,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.twitterDisconnect = function (fCallback) + RemoteAppStorage.prototype.twitterDisconnect = function (fCallback) { this.defaultRequest(fCallback, 'SocialTwitterDisconnect'); }; @@ -785,7 +784,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.googleUser = function (fCallback) + RemoteAppStorage.prototype.googleUser = function (fCallback) { this.defaultRequest(fCallback, 'SocialGoogleUserInformation'); }; @@ -793,7 +792,7 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.googleDisconnect = function (fCallback) + RemoteAppStorage.prototype.googleDisconnect = function (fCallback) { this.defaultRequest(fCallback, 'SocialGoogleDisconnect'); }; @@ -801,11 +800,11 @@ /** * @param {?Function} fCallback */ - RemoteStorage.prototype.socialUsers = function (fCallback) + RemoteAppStorage.prototype.socialUsers = function (fCallback) { this.defaultRequest(fCallback, 'SocialUsers'); }; - module.exports = new RemoteStorage(); + module.exports = new RemoteAppStorage(); }()); \ No newline at end of file diff --git a/dev/Storages/LocalStorage.js b/dev/Storage/Local.js similarity index 91% rename from dev/Storages/LocalStorage.js rename to dev/Storage/Local.js index 8ac649ba4..e5ff39955 100644 --- a/dev/Storages/LocalStorage.js +++ b/dev/Storage/Local.js @@ -11,8 +11,8 @@ { var NextStorageDriver = require('_').find([ - require('Storage:LocalStorage:LocalStorage'), - require('Storage:LocalStorage:Cookie') + require('Storage/LocalDriver/LocalStorage'), + require('Storage/LocalDriver/Cookie') ], function (NextStorageDriver) { return NextStorageDriver && NextStorageDriver.supported(); }) diff --git a/dev/Storages/LocalStorages/CookieDriver.js b/dev/Storage/LocalDriver/Cookie.js similarity index 86% rename from dev/Storages/LocalStorages/CookieDriver.js rename to dev/Storage/LocalDriver/Cookie.js index 5f544245b..2f6a4f432 100644 --- a/dev/Storages/LocalStorages/CookieDriver.js +++ b/dev/Storage/LocalDriver/Cookie.js @@ -15,7 +15,7 @@ /** * @constructor */ - function CookieDriver() + function CookieLocalDriver() { } @@ -23,7 +23,7 @@ * @static * @return {boolean} */ - CookieDriver.supported = function () + CookieLocalDriver.supported = function () { return !!(window.navigator && window.navigator.cookieEnabled); }; @@ -33,7 +33,7 @@ * @param {*} mData * @return {boolean} */ - CookieDriver.prototype.set = function (sKey, mData) + CookieLocalDriver.prototype.set = function (sKey, mData) { var mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName), @@ -71,7 +71,7 @@ * @param {string} sKey * @return {*} */ - CookieDriver.prototype.get = function (sKey) + CookieLocalDriver.prototype.get = function (sKey) { var mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName), @@ -95,6 +95,6 @@ return mResult; }; - module.exports = CookieDriver; + module.exports = CookieLocalDriver; }()); \ No newline at end of file diff --git a/dev/Storages/LocalStorages/LocalStorageDriver.js b/dev/Storage/LocalDriver/LocalStorage.js similarity index 84% rename from dev/Storages/LocalStorages/LocalStorageDriver.js rename to dev/Storage/LocalDriver/LocalStorage.js index d91217ce3..e3acbbbf9 100644 --- a/dev/Storages/LocalStorages/LocalStorageDriver.js +++ b/dev/Storage/LocalDriver/LocalStorage.js @@ -15,7 +15,7 @@ /** * @constructor */ - function LocalStorageDriver() + function LocalStorageLocalDriver() { } @@ -23,7 +23,7 @@ * @static * @return {boolean} */ - LocalStorageDriver.supported = function () + LocalStorageLocalDriver.supported = function () { return !!window.localStorage; }; @@ -33,7 +33,7 @@ * @param {*} mData * @return {boolean} */ - LocalStorageDriver.prototype.set = function (sKey, mData) + LocalStorageLocalDriver.prototype.set = function (sKey, mData) { var mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null, @@ -69,7 +69,7 @@ * @param {string} sKey * @return {*} */ - LocalStorageDriver.prototype.get = function (sKey) + LocalStorageLocalDriver.prototype.get = function (sKey) { var mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null, @@ -93,6 +93,6 @@ return mResult; }; - module.exports = LocalStorageDriver; + module.exports = LocalStorageLocalDriver; }()); \ No newline at end of file diff --git a/dev/Storages/SettingsStorage.js b/dev/Storage/Settings.js similarity index 100% rename from dev/Storages/SettingsStorage.js rename to dev/Storage/Settings.js diff --git a/dev/ViewModels/AdminLoginViewModel.js b/dev/View/Admin/Login.js similarity index 71% rename from dev/ViewModels/AdminLoginViewModel.js rename to dev/View/Admin/Login.js index 9d4791a29..57357ea55 100644 --- a/dev/ViewModels/AdminLoginViewModel.js +++ b/dev/View/Admin/Login.js @@ -10,19 +10,19 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Remote = require('Storage:Admin:Remote'), + Remote = require('Storage/Admin/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function AdminLoginViewModel() + function LoginAdminView() { - KnoinAbstractViewModel.call(this, 'Center', 'AdminLogin'); + AbstractView.call(this, 'Center', 'AdminLogin'); this.login = ko.observable(''); this.password = ko.observable(''); @@ -63,7 +63,7 @@ { if (oData.Result) { - require('App:Admin').loginAndLogoutReload(); + require('App/Admin').loginAndLogoutReload(); } else if (oData.ErrorCode) { @@ -88,10 +88,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Admin:Login', 'AdminLoginViewModel'], AdminLoginViewModel); - _.extend(AdminLoginViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Admin/Login', 'AdminLoginViewModel'], LoginAdminView); + _.extend(LoginAdminView.prototype, AbstractView.prototype); - AdminLoginViewModel.prototype.onShow = function () + LoginAdminView.prototype.onShow = function () { kn.routeOff(); @@ -101,21 +101,21 @@ }; - AdminLoginViewModel.prototype.onHide = function () + LoginAdminView.prototype.onHide = function () { this.loginFocus(false); }; - AdminLoginViewModel.prototype.onBuild = function () + LoginAdminView.prototype.onBuild = function () { Utils.triggerAutocompleteInputChange(true); }; - AdminLoginViewModel.prototype.submitForm = function () + LoginAdminView.prototype.submitForm = function () { this.submitCommand(); }; - module.exports = AdminLoginViewModel; + module.exports = LoginAdminView; }()); \ No newline at end of file diff --git a/dev/View/Admin/Settings/Menu.js b/dev/View/Admin/Settings/Menu.js new file mode 100644 index 000000000..a9693e246 --- /dev/null +++ b/dev/View/Admin/Settings/Menu.js @@ -0,0 +1,42 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + + Globals = require('Common/Globals'), + + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') + ; + + /** + * @param {?} oScreen + * + * @constructor + * @extends AbstractView + */ + function MenuSettingsAdminView(oScreen) + { + AbstractView.call(this, 'Left', 'AdminMenu'); + + this.leftPanelDisabled = Globals.leftPanelDisabled; + + this.menu = oScreen.menu; + + kn.constructorEnd(this); + } + + kn.extendAsViewModel(['View/Admin/Settings/Menu', 'AdminSettingsMenuViewModel'], MenuSettingsAdminView); + _.extend(MenuSettingsAdminView.prototype, AbstractView.prototype); + + MenuSettingsAdminView.prototype.link = function (sRoute) + { + return '#/' + sRoute; + }; + + module.exports = MenuSettingsAdminView; + +}()); diff --git a/dev/View/Admin/Settings/Pane.js b/dev/View/Admin/Settings/Pane.js new file mode 100644 index 000000000..4ef5f32d4 --- /dev/null +++ b/dev/View/Admin/Settings/Pane.js @@ -0,0 +1,46 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + ko = require('ko'), + + Settings = require('Storage/Settings'), + Data = require('Storage/Admin/Data'), + Remote = require('Storage/Admin/Remote'), + + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') + ; + + /** + * @constructor + * @extends AbstractView + */ + function PaneSettingsAdminView() + { + AbstractView.call(this, 'Right', 'AdminPane'); + + this.adminDomain = ko.observable(Settings.settingsGet('AdminDomain')); + this.version = ko.observable(Settings.settingsGet('Version')); + + this.adminManLoadingVisibility = Data.adminManLoadingVisibility; + + kn.constructorEnd(this); + } + + kn.extendAsViewModel(['View/Admin/Settings/Pane', 'AdminSettingsPaneViewModel'], PaneSettingsAdminView); + _.extend(PaneSettingsAdminView.prototype, AbstractView.prototype); + + PaneSettingsAdminView.prototype.logoutClick = function () + { + Remote.adminLogout(function () { + require('App/Admin').loginAndLogoutReload(); + }); + }; + + module.exports = PaneSettingsAdminView; + +}()); \ No newline at end of file diff --git a/dev/View/App/About.js b/dev/View/App/About.js new file mode 100644 index 000000000..09754b2af --- /dev/null +++ b/dev/View/App/About.js @@ -0,0 +1,34 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + ko = require('ko'), + + Settings = require('Storage/Settings'), + + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') + ; + + /** + * @constructor + * @extends AbstractView + */ + function AboutAppView() + { + AbstractView.call(this, 'Center', 'About'); + + this.version = ko.observable(Settings.settingsGet('Version')); + + kn.constructorEnd(this); + } + + kn.extendAsViewModel(['View/App/About', 'AboutViewModel'], AboutAppView); + _.extend(AboutAppView.prototype, AbstractView.prototype); + + module.exports = AboutAppView; + +}()); \ No newline at end of file diff --git a/dev/ViewModels/AbstractSystemDropDownViewModel.js b/dev/View/App/AbstractSystemDropDown.js similarity index 56% rename from dev/ViewModels/AbstractSystemDropDownViewModel.js rename to dev/View/App/AbstractSystemDropDown.js index 9bc69a438..4f8599473 100644 --- a/dev/ViewModels/AbstractSystemDropDownViewModel.js +++ b/dev/View/App/AbstractSystemDropDown.js @@ -13,20 +13,20 @@ Utils = require('Common/Utils'), LinkBuilder = require('Common/LinkBuilder'), - Settings = require('Storage:Settings'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote'), + Settings = require('Storage/Settings'), + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function AbstractSystemDropDownViewModel() + function AbstractSystemDropDownAppView() { - KnoinAbstractViewModel.call(this, 'Right', 'SystemDropDown'); + AbstractView.call(this, 'Right', 'SystemDropDown'); this.accounts = Data.accounts; this.accountEmail = Data.accountEmail; @@ -43,9 +43,9 @@ this.accountClick = _.bind(this.accountClick, this); } - _.extend(AbstractSystemDropDownViewModel.prototype, KnoinAbstractViewModel.prototype); + _.extend(AbstractSystemDropDownAppView.prototype, AbstractView.prototype); - AbstractSystemDropDownViewModel.prototype.accountClick = function (oAccount, oEvent) + AbstractSystemDropDownAppView.prototype.accountClick = function (oAccount, oEvent) { if (oAccount && oEvent && !Utils.isUnd(oEvent.which) && 1 === oEvent.which) { @@ -59,30 +59,30 @@ return true; }; - AbstractSystemDropDownViewModel.prototype.emailTitle = function () + AbstractSystemDropDownAppView.prototype.emailTitle = function () { return Data.accountEmail(); }; - AbstractSystemDropDownViewModel.prototype.settingsClick = function () + AbstractSystemDropDownAppView.prototype.settingsClick = function () { - require('App:Knoin').setHash(LinkBuilder.settings()); + require('Knoin/Knoin').setHash(LinkBuilder.settings()); }; - AbstractSystemDropDownViewModel.prototype.settingsHelp = function () + AbstractSystemDropDownAppView.prototype.settingsHelp = function () { - require('App:Knoin').showScreenPopup(require('View:Popup:KeyboardShortcutsHelp')); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/KeyboardShortcutsHelp')); }; - AbstractSystemDropDownViewModel.prototype.addAccountClick = function () + AbstractSystemDropDownAppView.prototype.addAccountClick = function () { if (this.capaAdditionalAccounts) { - require('App:Knoin').showScreenPopup(require('View:Popup:AddAccount')); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount')); } }; - AbstractSystemDropDownViewModel.prototype.logoutClick = function () + AbstractSystemDropDownAppView.prototype.logoutClick = function () { Remote.logout(function () { if (window.__rlah_clear) @@ -90,12 +90,12 @@ window.__rlah_clear(); } - require('App:RainLoop').loginAndLogoutReload(true, + require('App/App').loginAndLogoutReload(true, Settings.settingsGet('ParentEmail') && 0 < Settings.settingsGet('ParentEmail').length); }); }; - AbstractSystemDropDownViewModel.prototype.onBuild = function () + AbstractSystemDropDownAppView.prototype.onBuild = function () { var self = this; key('`', [Enums.KeyState.MessageList, Enums.KeyState.MessageView, Enums.KeyState.Settings], function () { @@ -109,12 +109,12 @@ key('shift+/', [Enums.KeyState.MessageList, Enums.KeyState.MessageView, Enums.KeyState.Settings], function () { if (self.viewModelVisibility()) { - require('App:Knoin').showScreenPopup(require('View:Popup:KeyboardShortcutsHelp')); + require('Knoin/Knoin').showScreenPopup(require('View/Popup/KeyboardShortcutsHelp')); return false; } }); }; - module.exports = AbstractSystemDropDownViewModel; + module.exports = AbstractSystemDropDownAppView; }()); \ No newline at end of file diff --git a/dev/ViewModels/LoginViewModel.js b/dev/View/App/Login.js similarity index 89% rename from dev/ViewModels/LoginViewModel.js rename to dev/View/App/Login.js index 2ef141401..f923de719 100644 --- a/dev/ViewModels/LoginViewModel.js +++ b/dev/View/App/Login.js @@ -13,21 +13,21 @@ Utils = require('Common/Utils'), LinkBuilder = require('Common/LinkBuilder'), - Settings = require('Storage:Settings'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote'), + Settings = require('Storage/Settings'), + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function LoginViewModel() + function LoginAppView() { - KnoinAbstractViewModel.call(this, 'Center', 'Login'); + AbstractView.call(this, 'Center', 'Login'); this.email = ko.observable(''); this.password = ko.observable(''); @@ -130,7 +130,7 @@ } else { - require('App:RainLoop').loginAndLogoutReload(); + require('App/App').loginAndLogoutReload(); } } else if (oData.ErrorCode) @@ -249,10 +249,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:RainLoop:Login', 'LoginViewModel'], LoginViewModel); - _.extend(LoginViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/App/Login', 'LoginViewModel'], LoginAppView); + _.extend(LoginAppView.prototype, AbstractView.prototype); - LoginViewModel.prototype.onShow = function () + LoginAppView.prototype.onShow = function () { kn.routeOff(); @@ -274,13 +274,13 @@ }, this), 100); }; - LoginViewModel.prototype.onHide = function () + LoginAppView.prototype.onHide = function () { this.submitFocus(false); this.emailFocus(false); }; - LoginViewModel.prototype.onBuild = function () + LoginAppView.prototype.onBuild = function () { var self = this, @@ -290,7 +290,7 @@ if (0 === iErrorCode) { self.submitRequest(true); - require('App:RainLoop').loginAndLogoutReload(); + require('App/App').loginAndLogoutReload(); } else { @@ -337,32 +337,32 @@ _.delay(function () { Data.language.subscribe(function (sValue) { - + self.langRequest(true); - + Utils.reloadLanguage(sValue, function() { self.bSendLanguage = true; $.cookie('rllang', sValue, {'expires': 30}); }, null, function() { self.langRequest(false); }); - + }); }, 50); Utils.triggerAutocompleteInputChange(true); }; - LoginViewModel.prototype.submitForm = function () + LoginAppView.prototype.submitForm = function () { this.submitCommand(); }; - LoginViewModel.prototype.selectLanguage = function () + LoginAppView.prototype.selectLanguage = function () { - kn.showScreenPopup(require('View:Popup:Languages')); + kn.showScreenPopup(require('View/Popup/Languages')); }; - module.exports = LoginViewModel; + module.exports = LoginAppView; }()); \ No newline at end of file diff --git a/dev/ViewModels/MailBoxFolderListViewModel.js b/dev/View/App/MailBox/FolderList.js similarity index 73% rename from dev/ViewModels/MailBoxFolderListViewModel.js rename to dev/View/App/MailBox/FolderList.js index 215587556..6ca5d49b2 100644 --- a/dev/ViewModels/MailBoxFolderListViewModel.js +++ b/dev/View/App/MailBox/FolderList.js @@ -15,21 +15,21 @@ Globals = require('Common/Globals'), LinkBuilder = require('Common/LinkBuilder'), - Settings = require('Storage:Settings'), - Cache = require('Storage:RainLoop:Cache'), - Data = require('Storage:RainLoop:Data'), + Settings = require('Storage/Settings'), + Cache = require('Storage/App/Cache'), + Data = require('Storage/App/Data'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function MailBoxFolderListViewModel() + function FolderListMailBoxAppView() { - KnoinAbstractViewModel.call(this, 'Left', 'MailFolderList'); + AbstractView.call(this, 'Left', 'MailFolderList'); this.oContentVisible = null; this.oContentScrollable = null; @@ -48,10 +48,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:RainLoop:MailBoxFolderList', 'MailBoxFolderListViewModel'], MailBoxFolderListViewModel); - _.extend(MailBoxFolderListViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/App/MailBox/FolderList', 'MailBoxFolderListViewModel'], FolderListMailBoxAppView); + _.extend(FolderListMailBoxAppView.prototype, AbstractView.prototype); - MailBoxFolderListViewModel.prototype.onBuild = function (oDom) + FolderListMailBoxAppView.prototype.onBuild = function (oDom) { this.oContentVisible = $('.b-content', oDom); this.oContentScrollable = $('.content', this.oContentVisible); @@ -69,7 +69,7 @@ if (oFolder && oEvent) { bCollapsed = oFolder.collapsed(); - require('App:RainLoop').setExpandedFolder(oFolder.fullNameHash, bCollapsed); + require('App/App').setExpandedFolder(oFolder.fullNameHash, bCollapsed); oFolder.collapsed(!bCollapsed); oEvent.preventDefault(); @@ -152,7 +152,7 @@ if (oFolder) { bCollapsed = oFolder.collapsed(); - require('App:RainLoop').setExpandedFolder(oFolder.fullNameHash, bCollapsed); + require('App/App').setExpandedFolder(oFolder.fullNameHash, bCollapsed); oFolder.collapsed(!bCollapsed); } } @@ -174,25 +174,25 @@ }); }; - MailBoxFolderListViewModel.prototype.messagesDropOver = function (oFolder) + FolderListMailBoxAppView.prototype.messagesDropOver = function (oFolder) { window.clearTimeout(this.iDropOverTimer); if (oFolder && oFolder.collapsed()) { this.iDropOverTimer = window.setTimeout(function () { oFolder.collapsed(false); - require('App:RainLoop').setExpandedFolder(oFolder.fullNameHash, true); + require('App/App').setExpandedFolder(oFolder.fullNameHash, true); Utils.windowResize(); }, 500); } }; - MailBoxFolderListViewModel.prototype.messagesDropOut = function () + FolderListMailBoxAppView.prototype.messagesDropOut = function () { window.clearTimeout(this.iDropOverTimer); }; - MailBoxFolderListViewModel.prototype.scrollToFocused = function () + FolderListMailBoxAppView.prototype.scrollToFocused = function () { if (!this.oContentVisible || !this.oContentScrollable) { @@ -229,7 +229,7 @@ * @param {FolderModel} oToFolder * @param {{helper:jQuery}} oUi */ - MailBoxFolderListViewModel.prototype.messagesDrop = function (oToFolder, oUi) + FolderListMailBoxAppView.prototype.messagesDrop = function (oToFolder, oUi) { if (oToFolder && oUi && oUi.helper) { @@ -241,34 +241,34 @@ if (Utils.isNormal(sFromFolderFullNameRaw) && '' !== sFromFolderFullNameRaw && Utils.isArray(aUids)) { - require('App:RainLoop').moveMessagesToFolder(sFromFolderFullNameRaw, aUids, oToFolder.fullNameRaw, bCopy); + require('App/App').moveMessagesToFolder(sFromFolderFullNameRaw, aUids, oToFolder.fullNameRaw, bCopy); } } }; - MailBoxFolderListViewModel.prototype.composeClick = function () + FolderListMailBoxAppView.prototype.composeClick = function () { - kn.showScreenPopup(require('View:Popup:Compose')); + kn.showScreenPopup(require('View/Popup/Compose')); }; - MailBoxFolderListViewModel.prototype.createFolder = function () + FolderListMailBoxAppView.prototype.createFolder = function () { - kn.showScreenPopup(require('View:Popup:FolderCreate')); + kn.showScreenPopup(require('View/Popup/FolderCreate')); }; - MailBoxFolderListViewModel.prototype.configureFolders = function () + FolderListMailBoxAppView.prototype.configureFolders = function () { kn.setHash(LinkBuilder.settings('folders')); }; - MailBoxFolderListViewModel.prototype.contactsClick = function () + FolderListMailBoxAppView.prototype.contactsClick = function () { if (this.allowContacts) { - kn.showScreenPopup(require('View:Popup:Contacts')); + kn.showScreenPopup(require('View/Popup/Contacts')); } }; - module.exports = MailBoxFolderListViewModel; + module.exports = FolderListMailBoxAppView; }()); diff --git a/dev/ViewModels/MailBoxMessageListViewModel.js b/dev/View/App/MailBox/MessageList.js similarity index 86% rename from dev/ViewModels/MailBoxMessageListViewModel.js rename to dev/View/App/MailBox/MessageList.js index 53d974f9c..2f73968ac 100644 --- a/dev/ViewModels/MailBoxMessageListViewModel.js +++ b/dev/View/App/MailBox/MessageList.js @@ -19,22 +19,22 @@ Events = require('Common/Events'), Selector = require('Common/Selector'), - Settings = require('Storage:Settings'), - Cache = require('Storage:RainLoop:Cache'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote'), + Settings = require('Storage/Settings'), + Cache = require('Storage/App/Cache'), + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function MailBoxMessageListViewModel() + function MessageListMailBoxAppView() { - KnoinAbstractViewModel.call(this, 'Right', 'MailMessageList'); + AbstractView.call(this, 'Right', 'MailMessageList'); this.sLastUid = null; this.bPrefetch = false; @@ -168,40 +168,40 @@ this.canBeMoved = this.hasCheckedOrSelectedLines; this.clearCommand = Utils.createCommand(this, function () { - kn.showScreenPopup(require('View:Popup:FolderClear'), [Data.currentFolder()]); + kn.showScreenPopup(require('View/Popup/FolderClear'), [Data.currentFolder()]); }); this.multyForwardCommand = Utils.createCommand(this, function () { - kn.showScreenPopup(require('View:Popup:Compose'), [ + kn.showScreenPopup(require('View/Popup/Compose'), [ Enums.ComposeType.ForwardAsAttachment, Data.messageListCheckedOrSelected()]); }, this.canBeMoved); this.deleteWithoutMoveCommand = Utils.createCommand(this, function () { - require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash, + require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash, Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), false); }, this.canBeMoved); this.deleteCommand = Utils.createCommand(this, function () { - require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash, + require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash, Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), true); }, this.canBeMoved); this.archiveCommand = Utils.createCommand(this, function () { - require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Archive, + require('App/App').deleteMessagesFromFolder(Enums.FolderType.Archive, Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), true); }, this.canBeMoved); this.spamCommand = Utils.createCommand(this, function () { - require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Spam, + require('App/App').deleteMessagesFromFolder(Enums.FolderType.Spam, Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), true); }, this.canBeMoved); this.notSpamCommand = Utils.createCommand(this, function () { - require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.NotSpam, + require('App/App').deleteMessagesFromFolder(Enums.FolderType.NotSpam, Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), true); }, this.canBeMoved); @@ -211,7 +211,7 @@ this.reloadCommand = Utils.createCommand(this, function () { if (!Data.messageListCompleteLoadingThrottle()) { - require('App:RainLoop').reloadMessageList(false, true); + require('App/App').reloadMessageList(false, true); } }); @@ -265,15 +265,15 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:RainLoop:MailBoxMessageList', 'MailBoxMessageListViewModel'], MailBoxMessageListViewModel); - _.extend(MailBoxMessageListViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/App/MailBox/MessageList', 'MailBoxMessageListViewModel'], MessageListMailBoxAppView); + _.extend(MessageListMailBoxAppView.prototype, AbstractView.prototype); /** * @type {string} */ - MailBoxMessageListViewModel.prototype.emptySubjectValue = ''; + MessageListMailBoxAppView.prototype.emptySubjectValue = ''; - MailBoxMessageListViewModel.prototype.searchEnterAction = function () + MessageListMailBoxAppView.prototype.searchEnterAction = function () { this.mainMessageListSearch(this.sLastSearchValue); this.inputMessageListSearchFocus(false); @@ -282,13 +282,13 @@ /** * @returns {string} */ - MailBoxMessageListViewModel.prototype.printableMessageCountForDeletion = function () + MessageListMailBoxAppView.prototype.printableMessageCountForDeletion = function () { var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length; return 1 < iCnt ? ' (' + (100 > iCnt ? iCnt : '99+') + ')' : ''; }; - MailBoxMessageListViewModel.prototype.cancelSearch = function () + MessageListMailBoxAppView.prototype.cancelSearch = function () { this.mainMessageListSearch(''); this.inputMessageListSearchFocus(false); @@ -299,11 +299,11 @@ * @param {boolean} bCopy * @return {boolean} */ - MailBoxMessageListViewModel.prototype.moveSelectedMessagesToFolder = function (sToFolderFullNameRaw, bCopy) + MessageListMailBoxAppView.prototype.moveSelectedMessagesToFolder = function (sToFolderFullNameRaw, bCopy) { if (this.canBeMoved()) { - require('App:RainLoop').moveMessagesToFolder( + require('App/App').moveMessagesToFolder( Data.currentFolderFullNameRaw(), Data.messageListCheckedOrSelectedUidsWithSubMails(), sToFolderFullNameRaw, bCopy); } @@ -311,7 +311,7 @@ return false; }; - MailBoxMessageListViewModel.prototype.dragAndDronHelper = function (oMessageListItem) + MessageListMailBoxAppView.prototype.dragAndDronHelper = function (oMessageListItem) { if (oMessageListItem) { @@ -342,7 +342,7 @@ * @param {AjaxJsonDefaultResponse} oData * @param {boolean} bCached */ - MailBoxMessageListViewModel.prototype.onMessageResponse = function (sResult, oData, bCached) + MessageListMailBoxAppView.prototype.onMessageResponse = function (sResult, oData, bCached) { Data.hideMessageBodies(); Data.messageLoading(false); @@ -365,7 +365,7 @@ } }; - MailBoxMessageListViewModel.prototype.populateMessageBody = function (oMessage) + MessageListMailBoxAppView.prototype.populateMessageBody = function (oMessage) { if (oMessage) { @@ -385,7 +385,7 @@ * @param {number} iSetAction * @param {Array=} aMessages = null */ - MailBoxMessageListViewModel.prototype.setAction = function (sFolderFullNameRaw, iSetAction, aMessages) + MessageListMailBoxAppView.prototype.setAction = function (sFolderFullNameRaw, iSetAction, aMessages) { var aUids = [], @@ -458,7 +458,7 @@ break; } - require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache(); + require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache(); } }; @@ -466,7 +466,7 @@ * @param {string} sFolderFullNameRaw * @param {number} iSetAction */ - MailBoxMessageListViewModel.prototype.setActionForAll = function (sFolderFullNameRaw, iSetAction) + MessageListMailBoxAppView.prototype.setActionForAll = function (sFolderFullNameRaw, iSetAction) { var oFolder = null, @@ -509,37 +509,37 @@ break; } - require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache(); + require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache(); } } }; - MailBoxMessageListViewModel.prototype.listSetSeen = function () + MessageListMailBoxAppView.prototype.listSetSeen = function () { this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetSeen, Data.messageListCheckedOrSelected()); }; - MailBoxMessageListViewModel.prototype.listSetAllSeen = function () + MessageListMailBoxAppView.prototype.listSetAllSeen = function () { this.setActionForAll(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetSeen); }; - MailBoxMessageListViewModel.prototype.listUnsetSeen = function () + MessageListMailBoxAppView.prototype.listUnsetSeen = function () { this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.UnsetSeen, Data.messageListCheckedOrSelected()); }; - MailBoxMessageListViewModel.prototype.listSetFlags = function () + MessageListMailBoxAppView.prototype.listSetFlags = function () { this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetFlag, Data.messageListCheckedOrSelected()); }; - MailBoxMessageListViewModel.prototype.listUnsetFlags = function () + MessageListMailBoxAppView.prototype.listUnsetFlags = function () { this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.UnsetFlag, Data.messageListCheckedOrSelected()); }; - MailBoxMessageListViewModel.prototype.flagMessages = function (oCurrentMessage) + MessageListMailBoxAppView.prototype.flagMessages = function (oCurrentMessage) { var aChecked = this.messageListCheckedOrSelected(), @@ -568,7 +568,7 @@ } }; - MailBoxMessageListViewModel.prototype.flagMessagesFast = function (bFlag) + MessageListMailBoxAppView.prototype.flagMessagesFast = function (bFlag) { var aChecked = this.messageListCheckedOrSelected(), @@ -594,7 +594,7 @@ } }; - MailBoxMessageListViewModel.prototype.seenMessagesFast = function (bSeen) + MessageListMailBoxAppView.prototype.seenMessagesFast = function (bSeen) { var aChecked = this.messageListCheckedOrSelected(), @@ -620,7 +620,7 @@ } }; - MailBoxMessageListViewModel.prototype.onBuild = function (oDom) + MessageListMailBoxAppView.prototype.onBuild = function (oDom) { var self = this; @@ -653,7 +653,7 @@ oMessage.lastInCollapsedThreadLoading(true); oMessage.lastInCollapsedThread(!oMessage.lastInCollapsedThread()); - require('App:RainLoop').reloadMessageList(); + require('App/App').reloadMessageList(); } return false; @@ -700,7 +700,7 @@ } }; - MailBoxMessageListViewModel.prototype.initShortcuts = function () + MessageListMailBoxAppView.prototype.initShortcuts = function () { var self = this; @@ -749,7 +749,7 @@ // write/compose (open compose popup) key('w,c', [Enums.KeyState.MessageList, Enums.KeyState.MessageView], function () { - kn.showScreenPopup(require('View:Popup:Compose')); + kn.showScreenPopup(require('View/Popup/Compose')); return false; }); @@ -822,7 +822,7 @@ }); }; - MailBoxMessageListViewModel.prototype.prefetchNextTick = function () + MessageListMailBoxAppView.prototype.prefetchNextTick = function () { if (!this.bPrefetch && !ifvisible.now() && this.viewModelVisibility()) { @@ -857,17 +857,17 @@ } }; - MailBoxMessageListViewModel.prototype.composeClick = function () + MessageListMailBoxAppView.prototype.composeClick = function () { - kn.showScreenPopup(require('View:Popup:Compose')); + kn.showScreenPopup(require('View/Popup/Compose')); }; - MailBoxMessageListViewModel.prototype.advancedSearchClick = function () + MessageListMailBoxAppView.prototype.advancedSearchClick = function () { - kn.showScreenPopup(require('View:Popup:AdvancedSearch')); + kn.showScreenPopup(require('View/Popup/AdvancedSearch')); }; - MailBoxMessageListViewModel.prototype.quotaTooltip = function () + MessageListMailBoxAppView.prototype.quotaTooltip = function () { return Utils.i18n('MESSAGE_LIST/QUOTA_SIZE', { 'SIZE': Utils.friendlySize(this.userUsageSize()), @@ -876,7 +876,7 @@ }); }; - MailBoxMessageListViewModel.prototype.initUploaderForAppend = function () + MessageListMailBoxAppView.prototype.initUploaderForAppend = function () { if (!Settings.settingsGet('AllowAppendMessage') || !this.dragOverArea()) { @@ -923,13 +923,13 @@ return false; }, this)) .on('onComplete', _.bind(function () { - require('App:RainLoop').reloadMessageList(true, true); + require('App/App').reloadMessageList(true, true); }, this)) ; return !!oJua; }; - module.exports = MailBoxMessageListViewModel; + module.exports = MessageListMailBoxAppView; }()); diff --git a/dev/ViewModels/MailBoxMessageViewViewModel.js b/dev/View/App/MailBox/MessageView.js similarity index 82% rename from dev/ViewModels/MailBoxMessageViewViewModel.js rename to dev/View/App/MailBox/MessageView.js index c91d7ade2..4330ca888 100644 --- a/dev/ViewModels/MailBoxMessageViewViewModel.js +++ b/dev/View/App/MailBox/MessageView.js @@ -15,21 +15,21 @@ Utils = require('Common/Utils'), Events = require('Common/Events'), - Cache = require('Storage:RainLoop:Cache'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote'), + Cache = require('Storage/App/Cache'), + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function MailBoxMessageViewViewModel() + function MessageViewMailBoxAppView() { - KnoinAbstractViewModel.call(this, 'Right', 'MailMessageView'); + AbstractView.call(this, 'Right', 'MailMessageView'); var self = this, @@ -98,7 +98,7 @@ this.deleteCommand = Utils.createCommand(this, function () { if (this.message()) { - require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash, + require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash, this.message().folderFullNameRaw, [this.message().uid], true); } @@ -107,7 +107,7 @@ this.deleteWithoutMoveCommand = Utils.createCommand(this, function () { if (this.message()) { - require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash, + require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash, Data.currentFolderFullNameRaw(), [this.message().uid], false); } @@ -116,7 +116,7 @@ this.archiveCommand = Utils.createCommand(this, function () { if (this.message()) { - require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Archive, + require('App/App').deleteMessagesFromFolder(Enums.FolderType.Archive, this.message().folderFullNameRaw, [this.message().uid], true); } @@ -125,7 +125,7 @@ this.spamCommand = Utils.createCommand(this, function () { if (this.message()) { - require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Spam, + require('App/App').deleteMessagesFromFolder(Enums.FolderType.Spam, this.message().folderFullNameRaw, [this.message().uid], true); } @@ -134,7 +134,7 @@ this.notSpamCommand = Utils.createCommand(this, function () { if (this.message()) { - require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.NotSpam, + require('App/App').deleteMessagesFromFolder(Enums.FolderType.NotSpam, this.message().folderFullNameRaw, [this.message().uid], true); } @@ -248,25 +248,25 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:RainLoop:MailBoxMessageView', 'MailBoxMessageViewViewModel'], MailBoxMessageViewViewModel); - _.extend(MailBoxMessageViewViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/App/MailBox/MessageView', 'MailBoxMessageViewViewModel'], MessageViewMailBoxAppView); + _.extend(MessageViewMailBoxAppView.prototype, AbstractView.prototype); - MailBoxMessageViewViewModel.prototype.isPgpActionVisible = function () + MessageViewMailBoxAppView.prototype.isPgpActionVisible = function () { return Enums.SignedVerifyStatus.Success !== this.viewPgpSignedVerifyStatus(); }; - MailBoxMessageViewViewModel.prototype.isPgpStatusVerifyVisible = function () + MessageViewMailBoxAppView.prototype.isPgpStatusVerifyVisible = function () { return Enums.SignedVerifyStatus.None !== this.viewPgpSignedVerifyStatus(); }; - MailBoxMessageViewViewModel.prototype.isPgpStatusVerifySuccess = function () + MessageViewMailBoxAppView.prototype.isPgpStatusVerifySuccess = function () { return Enums.SignedVerifyStatus.Success === this.viewPgpSignedVerifyStatus(); }; - MailBoxMessageViewViewModel.prototype.pgpStatusVerifyMessage = function () + MessageViewMailBoxAppView.prototype.pgpStatusVerifyMessage = function () { var sResult = ''; switch (this.viewPgpSignedVerifyStatus()) @@ -293,19 +293,19 @@ return sResult; }; - MailBoxMessageViewViewModel.prototype.fullScreen = function () + MessageViewMailBoxAppView.prototype.fullScreen = function () { this.fullScreenMode(true); Utils.windowResize(); }; - MailBoxMessageViewViewModel.prototype.unFullScreen = function () + MessageViewMailBoxAppView.prototype.unFullScreen = function () { this.fullScreenMode(false); Utils.windowResize(); }; - MailBoxMessageViewViewModel.prototype.toggleFullScreen = function () + MessageViewMailBoxAppView.prototype.toggleFullScreen = function () { Utils.removeSelection(); @@ -316,12 +316,12 @@ /** * @param {string} sType */ - MailBoxMessageViewViewModel.prototype.replyOrforward = function (sType) + MessageViewMailBoxAppView.prototype.replyOrforward = function (sType) { - kn.showScreenPopup(require('View:Popup:Compose'), [sType, Data.message()]); + kn.showScreenPopup(require('View/Popup/Compose'), [sType, Data.message()]); }; - MailBoxMessageViewViewModel.prototype.onBuild = function (oDom) + MessageViewMailBoxAppView.prototype.onBuild = function (oDom) { var self = this; this.fullScreenMode.subscribe(function (bValue) { @@ -354,7 +354,7 @@ oDom .on('click', 'a', function (oEvent) { // setup maito protocol - return !(!!oEvent && 3 !== oEvent['which'] && Utils.mailToHelper($(this).attr('href'), require('View:Popup:Compose'))); + return !(!!oEvent && 3 !== oEvent['which'] && Utils.mailToHelper($(this).attr('href'), require('View/Popup/Compose'))); }) .on('click', '.attachmentsPlace .attachmentPreview', function (oEvent) { if (oEvent && oEvent.stopPropagation) @@ -370,7 +370,7 @@ if (oAttachment && oAttachment.download) { - require('App:RainLoop').download(oAttachment.linkDownload()); + require('App/App').download(oAttachment.linkDownload()); } }) ; @@ -408,7 +408,7 @@ /** * @return {boolean} */ - MailBoxMessageViewViewModel.prototype.escShortcuts = function () + MessageViewMailBoxAppView.prototype.escShortcuts = function () { if (this.viewModelVisibility() && this.message()) { @@ -429,7 +429,7 @@ } }; - MailBoxMessageViewViewModel.prototype.initShortcuts = function () + MessageViewMailBoxAppView.prototype.initShortcuts = function () { var self = this @@ -570,7 +570,7 @@ /** * @return {boolean} */ - MailBoxMessageViewViewModel.prototype.isDraftFolder = function () + MessageViewMailBoxAppView.prototype.isDraftFolder = function () { return Data.message() && Data.draftFolder() === Data.message().folderFullNameRaw; }; @@ -578,7 +578,7 @@ /** * @return {boolean} */ - MailBoxMessageViewViewModel.prototype.isSentFolder = function () + MessageViewMailBoxAppView.prototype.isSentFolder = function () { return Data.message() && Data.sentFolder() === Data.message().folderFullNameRaw; }; @@ -586,7 +586,7 @@ /** * @return {boolean} */ - MailBoxMessageViewViewModel.prototype.isSpamFolder = function () + MessageViewMailBoxAppView.prototype.isSpamFolder = function () { return Data.message() && Data.spamFolder() === Data.message().folderFullNameRaw; }; @@ -594,7 +594,7 @@ /** * @return {boolean} */ - MailBoxMessageViewViewModel.prototype.isSpamDisabled = function () + MessageViewMailBoxAppView.prototype.isSpamDisabled = function () { return Data.message() && Data.spamFolder() === Consts.Values.UnuseOptionValue; }; @@ -602,7 +602,7 @@ /** * @return {boolean} */ - MailBoxMessageViewViewModel.prototype.isArchiveFolder = function () + MessageViewMailBoxAppView.prototype.isArchiveFolder = function () { return Data.message() && Data.archiveFolder() === Data.message().folderFullNameRaw; }; @@ -610,7 +610,7 @@ /** * @return {boolean} */ - MailBoxMessageViewViewModel.prototype.isArchiveDisabled = function () + MessageViewMailBoxAppView.prototype.isArchiveDisabled = function () { return Data.message() && Data.archiveFolder() === Consts.Values.UnuseOptionValue; }; @@ -618,25 +618,25 @@ /** * @return {boolean} */ - MailBoxMessageViewViewModel.prototype.isDraftOrSentFolder = function () + MessageViewMailBoxAppView.prototype.isDraftOrSentFolder = function () { return this.isDraftFolder() || this.isSentFolder(); }; - MailBoxMessageViewViewModel.prototype.composeClick = function () + MessageViewMailBoxAppView.prototype.composeClick = function () { - kn.showScreenPopup(require('View:Popup:Compose')); + kn.showScreenPopup(require('View/Popup/Compose')); }; - MailBoxMessageViewViewModel.prototype.editMessage = function () + MessageViewMailBoxAppView.prototype.editMessage = function () { if (Data.message()) { - kn.showScreenPopup(require('View:Popup:Compose'), [Enums.ComposeType.Draft, Data.message()]); + kn.showScreenPopup(require('View/Popup/Compose'), [Enums.ComposeType.Draft, Data.message()]); } }; - MailBoxMessageViewViewModel.prototype.scrollMessageToTop = function () + MessageViewMailBoxAppView.prototype.scrollMessageToTop = function () { if (this.oMessageScrollerDom) { @@ -645,7 +645,7 @@ } }; - MailBoxMessageViewViewModel.prototype.scrollMessageToLeft = function () + MessageViewMailBoxAppView.prototype.scrollMessageToLeft = function () { if (this.oMessageScrollerDom) { @@ -657,7 +657,7 @@ /** * @param {MessageModel} oMessage */ - MailBoxMessageViewViewModel.prototype.showImages = function (oMessage) + MessageViewMailBoxAppView.prototype.showImages = function (oMessage) { if (oMessage && oMessage.showExternalImages) { @@ -668,7 +668,7 @@ /** * @returns {string} */ - MailBoxMessageViewViewModel.prototype.printableCheckedMessageCount = function () + MessageViewMailBoxAppView.prototype.printableCheckedMessageCount = function () { var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length; return 0 < iCnt ? (100 > iCnt ? iCnt : '99+') : ''; @@ -678,7 +678,7 @@ /** * @param {MessageModel} oMessage */ - MailBoxMessageViewViewModel.prototype.verifyPgpSignedClearMessage = function (oMessage) + MessageViewMailBoxAppView.prototype.verifyPgpSignedClearMessage = function (oMessage) { if (oMessage) { @@ -689,7 +689,7 @@ /** * @param {MessageModel} oMessage */ - MailBoxMessageViewViewModel.prototype.decryptPgpEncryptedMessage = function (oMessage) + MessageViewMailBoxAppView.prototype.decryptPgpEncryptedMessage = function (oMessage) { if (oMessage) { @@ -700,7 +700,7 @@ /** * @param {MessageModel} oMessage */ - MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage) + MessageViewMailBoxAppView.prototype.readReceipt = function (oMessage) { if (oMessage && '' !== oMessage.readReceipt()) { @@ -713,10 +713,10 @@ Cache.storeMessageFlagsToCache(oMessage); - require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache(); + require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache(); } }; - module.exports = MailBoxMessageViewViewModel; + module.exports = MessageViewMailBoxAppView; }()); \ No newline at end of file diff --git a/dev/View/App/MailBox/SystemDropDown.js b/dev/View/App/MailBox/SystemDropDown.js new file mode 100644 index 000000000..c8d6e92c4 --- /dev/null +++ b/dev/View/App/MailBox/SystemDropDown.js @@ -0,0 +1,28 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + + kn = require('Knoin/Knoin'), + AbstractSystemDropDownViewModel = require('View/App/AbstractSystemDropDown') + ; + + /** + * @constructor + * @extends AbstractSystemDropDownViewModel + */ + function SystemDropDownMailBoxAppView() + { + AbstractSystemDropDownViewModel.call(this); + kn.constructorEnd(this); + } + + kn.extendAsViewModel(['View/App/MailBox/SystemDropDown', 'MailBoxSystemDropDownViewModel'], SystemDropDownMailBoxAppView); + _.extend(SystemDropDownMailBoxAppView.prototype, AbstractSystemDropDownViewModel.prototype); + + module.exports = SystemDropDownMailBoxAppView; + +}()); diff --git a/dev/View/App/Settings/Menu.js b/dev/View/App/Settings/Menu.js new file mode 100644 index 000000000..c50d1933f --- /dev/null +++ b/dev/View/App/Settings/Menu.js @@ -0,0 +1,48 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + + Globals = require('Common/Globals'), + LinkBuilder = require('Common/LinkBuilder'), + + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') + ; + + /** + * @param {?} oScreen + * + * @constructor + * @extends AbstractView + */ + function MenuSettingsAppView(oScreen) + { + AbstractView.call(this, 'Left', 'SettingsMenu'); + + this.leftPanelDisabled = Globals.leftPanelDisabled; + + this.menu = oScreen.menu; + + kn.constructorEnd(this); + } + + kn.extendAsViewModel(['View/App/Settings/Menu', 'SettingsMenuViewModel'], MenuSettingsAppView); + _.extend(MenuSettingsAppView.prototype, AbstractView.prototype); + + MenuSettingsAppView.prototype.link = function (sRoute) + { + return LinkBuilder.settings(sRoute); + }; + + MenuSettingsAppView.prototype.backToMailBoxClick = function () + { + kn.setHash(LinkBuilder.inbox()); + }; + + module.exports = MenuSettingsAppView; + +}()); \ No newline at end of file diff --git a/dev/View/App/Settings/Pane.js b/dev/View/App/Settings/Pane.js new file mode 100644 index 000000000..9be8f80cb --- /dev/null +++ b/dev/View/App/Settings/Pane.js @@ -0,0 +1,53 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + key = require('key'), + + Enums = require('Common/Enums'), + LinkBuilder = require('Common/LinkBuilder'), + + Data = require('Storage/App/Data'), + + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') + ; + + /** + * @constructor + * @extends AbstractView + */ + function PaneSettingsAppView() + { + AbstractView.call(this, 'Right', 'SettingsPane'); + + kn.constructorEnd(this); + } + + kn.extendAsViewModel(['View/App/Settings/Pane', 'SettingsPaneViewModel'], PaneSettingsAppView); + _.extend(PaneSettingsAppView.prototype, AbstractView.prototype); + + PaneSettingsAppView.prototype.onBuild = function () + { + var self = this; + key('esc', Enums.KeyState.Settings, function () { + self.backToMailBoxClick(); + }); + }; + + PaneSettingsAppView.prototype.onShow = function () + { + Data.message(null); + }; + + PaneSettingsAppView.prototype.backToMailBoxClick = function () + { + kn.setHash(LinkBuilder.inbox()); + }; + + module.exports = PaneSettingsAppView; + +}()); \ No newline at end of file diff --git a/dev/View/App/Settings/SystemDropDown.js b/dev/View/App/Settings/SystemDropDown.js new file mode 100644 index 000000000..025f9fbe7 --- /dev/null +++ b/dev/View/App/Settings/SystemDropDown.js @@ -0,0 +1,28 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + + kn = require('Knoin/Knoin'), + AbstractSystemDropDownAppView = require('View/App/AbstractSystemDropDown') + ; + + /** + * @constructor + * @extends AbstractSystemDropDownAppView + */ + function SystemDropDownSettingsAppView() + { + AbstractSystemDropDownAppView.call(this); + kn.constructorEnd(this); + } + + kn.extendAsViewModel(['View/App/Settings/SystemDropDown', 'SettingsSystemDropDownViewModel'], SystemDropDownSettingsAppView); + _.extend(SystemDropDownSettingsAppView.prototype, AbstractSystemDropDownAppView.prototype); + + module.exports = SystemDropDownSettingsAppView; + +}()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsActivateViewModel.js b/dev/View/Popup/Activate.js similarity index 77% rename from dev/ViewModels/Popups/PopupsActivateViewModel.js rename to dev/View/Popup/Activate.js index 6c9f3afb7..f075ad4e0 100644 --- a/dev/ViewModels/Popups/PopupsActivateViewModel.js +++ b/dev/View/Popup/Activate.js @@ -10,21 +10,21 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Settings = require('Storage:Settings'), - Data = require('Storage:Admin:Data'), - Remote = require('Storage:Admin:Remote'), + Settings = require('Storage/Settings'), + Data = require('Storage/Admin/Data'), + Remote = require('Storage/Admin/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsActivateViewModel() + function ActivatePopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsActivate'); + AbstractView.call(this, 'Popups', 'PopupsActivate'); var self = this; @@ -104,10 +104,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:Activate', 'PopupsActivateViewModel'], PopupsActivateViewModel); - _.extend(PopupsActivateViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/Activate', 'PopupsActivateViewModel'], ActivatePopupView); + _.extend(ActivatePopupView.prototype, AbstractView.prototype); - PopupsActivateViewModel.prototype.onShow = function () + ActivatePopupView.prototype.onShow = function () { this.domain(Settings.settingsGet('AdminDomain')); if (!this.activateProcess()) @@ -119,7 +119,7 @@ } }; - PopupsActivateViewModel.prototype.onFocus = function () + ActivatePopupView.prototype.onFocus = function () { if (!this.activateProcess()) { @@ -130,12 +130,12 @@ /** * @returns {boolean} */ - PopupsActivateViewModel.prototype.validateSubscriptionKey = function () + ActivatePopupView.prototype.validateSubscriptionKey = function () { var sValue = this.key(); return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue)); }; - module.exports = PopupsActivateViewModel; + module.exports = ActivatePopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsAddAccountViewModel.js b/dev/View/Popup/AddAccount.js similarity index 70% rename from dev/ViewModels/Popups/PopupsAddAccountViewModel.js rename to dev/View/Popup/AddAccount.js index 94c035783..fb4ef136b 100644 --- a/dev/ViewModels/Popups/PopupsAddAccountViewModel.js +++ b/dev/View/Popup/AddAccount.js @@ -10,19 +10,19 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Remote = require('Storage:RainLoop:Remote'), + Remote = require('Storage/App/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsAddAccountViewModel() + function AddAccountPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddAccount'); + AbstractView.call(this, 'Popups', 'PopupsAddAccount'); this.email = ko.observable(''); this.password = ko.observable(''); @@ -62,7 +62,7 @@ { if (oData.Result) { - require('App:RainLoop').accountsAndIdentities(); + require('App/App').accountsAndIdentities(); this.cancelCommand(); } else if (oData.ErrorCode) @@ -86,10 +86,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:AddAccount', 'PopupsAddAccountViewModel'], PopupsAddAccountViewModel); - _.extend(PopupsAddAccountViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/AddAccount', 'PopupsAddAccountViewModel'], AddAccountPopupView); + _.extend(AddAccountPopupView.prototype, AbstractView.prototype); - PopupsAddAccountViewModel.prototype.clearPopup = function () + AddAccountPopupView.prototype.clearPopup = function () { this.email(''); this.password(''); @@ -101,16 +101,16 @@ this.submitError(''); }; - PopupsAddAccountViewModel.prototype.onShow = function () + AddAccountPopupView.prototype.onShow = function () { this.clearPopup(); }; - PopupsAddAccountViewModel.prototype.onFocus = function () + AddAccountPopupView.prototype.onFocus = function () { this.emailFocus(true); }; - module.exports = PopupsAddAccountViewModel; + module.exports = AddAccountPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js b/dev/View/Popup/AddOpenPgpKey.js similarity index 68% rename from dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js rename to dev/View/Popup/AddOpenPgpKey.js index d8ef0344a..7ab73a0da 100644 --- a/dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js +++ b/dev/View/Popup/AddOpenPgpKey.js @@ -9,19 +9,19 @@ Utils = require('Common/Utils'), - Data = require('Storage:RainLoop:Data'), + Data = require('Storage/App/Data'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsAddOpenPgpKeyViewModel() + function AddOpenPgpKeyPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddOpenPgpKey'); + AbstractView.call(this, 'Popups', 'PopupsAddOpenPgpKey'); this.key = ko.observable(''); this.key.error = ko.observable(false); @@ -77,7 +77,7 @@ oOpenpgpKeyring.store(); - require('App:RainLoop').reloadOpenPgpKeys(); + require('App/App').reloadOpenPgpKeys(); Utils.delegateRun(this, 'cancelCommand'); return true; @@ -86,25 +86,25 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:AddOpenPgpKey', 'PopupsAddOpenPgpKeyViewModel'], PopupsAddOpenPgpKeyViewModel); - _.extend(PopupsAddOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/AddOpenPgpKey', 'PopupsAddOpenPgpKeyViewModel'], AddOpenPgpKeyPopupView); + _.extend(AddOpenPgpKeyPopupView.prototype, AbstractView.prototype); - PopupsAddOpenPgpKeyViewModel.prototype.clearPopup = function () + AddOpenPgpKeyPopupView.prototype.clearPopup = function () { this.key(''); this.key.error(false); }; - PopupsAddOpenPgpKeyViewModel.prototype.onShow = function () + AddOpenPgpKeyPopupView.prototype.onShow = function () { this.clearPopup(); }; - PopupsAddOpenPgpKeyViewModel.prototype.onFocus = function () + AddOpenPgpKeyPopupView.prototype.onFocus = function () { this.key.focus(true); }; - module.exports = PopupsAddOpenPgpKeyViewModel; + module.exports = AddOpenPgpKeyPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js b/dev/View/Popup/AdvancedSearch.js similarity index 71% rename from dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js rename to dev/View/Popup/AdvancedSearch.js index df6aabdcb..70e65cc0e 100644 --- a/dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js +++ b/dev/View/Popup/AdvancedSearch.js @@ -10,19 +10,19 @@ Utils = require('Common/Utils'), - Data = require('Storage:RainLoop:Data'), + Data = require('Storage/App/Data'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsAdvancedSearchViewModel() + function AdvancedSearchPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAdvancedSearch'); + AbstractView.call(this, 'Popups', 'PopupsAdvancedSearch'); this.fromFocus = ko.observable(false); @@ -50,10 +50,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:AdvancedSearch', 'PopupsAdvancedSearchViewModel'], PopupsAdvancedSearchViewModel); - _.extend(PopupsAdvancedSearchViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/AdvancedSearch', 'PopupsAdvancedSearchViewModel'], AdvancedSearchPopupView); + _.extend(AdvancedSearchPopupView.prototype, AbstractView.prototype); - PopupsAdvancedSearchViewModel.prototype.buildSearchStringValue = function (sValue) + AdvancedSearchPopupView.prototype.buildSearchStringValue = function (sValue) { if (-1 < sValue.indexOf(' ')) { @@ -63,7 +63,7 @@ return sValue; }; - PopupsAdvancedSearchViewModel.prototype.buildSearchString = function () + AdvancedSearchPopupView.prototype.buildSearchString = function () { var aResult = [], @@ -128,7 +128,7 @@ return Utils.trim(aResult.join(' ')); }; - PopupsAdvancedSearchViewModel.prototype.clearPopup = function () + AdvancedSearchPopupView.prototype.clearPopup = function () { this.from(''); this.to(''); @@ -143,16 +143,16 @@ this.fromFocus(true); }; - PopupsAdvancedSearchViewModel.prototype.onShow = function () + AdvancedSearchPopupView.prototype.onShow = function () { this.clearPopup(); }; - PopupsAdvancedSearchViewModel.prototype.onFocus = function () + AdvancedSearchPopupView.prototype.onFocus = function () { this.fromFocus(true); }; - module.exports = PopupsAdvancedSearchViewModel; + module.exports = AdvancedSearchPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsAskViewModel.js b/dev/View/Popup/Ask.js similarity index 69% rename from dev/ViewModels/Popups/PopupsAskViewModel.js rename to dev/View/Popup/Ask.js index 166bb48af..01466ce5b 100644 --- a/dev/ViewModels/Popups/PopupsAskViewModel.js +++ b/dev/View/Popup/Ask.js @@ -11,17 +11,17 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsAskViewModel() + function AskPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAsk'); + AbstractView.call(this, 'Popups', 'PopupsAsk'); this.askDesc = ko.observable(''); this.yesButton = ko.observable(''); @@ -39,10 +39,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:Ask', 'PopupsAskViewModel'], PopupsAskViewModel); - _.extend(PopupsAskViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/Ask', 'PopupsAskViewModel'], AskPopupView); + _.extend(AskPopupView.prototype, AbstractView.prototype); - PopupsAskViewModel.prototype.clearPopup = function () + AskPopupView.prototype.clearPopup = function () { this.askDesc(''); this.yesButton(Utils.i18n('POPUPS_ASK/BUTTON_YES')); @@ -55,7 +55,7 @@ this.fNoAction = null; }; - PopupsAskViewModel.prototype.yesClick = function () + AskPopupView.prototype.yesClick = function () { this.cancelCommand(); @@ -65,7 +65,7 @@ } }; - PopupsAskViewModel.prototype.noClick = function () + AskPopupView.prototype.noClick = function () { this.cancelCommand(); @@ -82,7 +82,7 @@ * @param {string=} sYesButton * @param {string=} sNoButton */ - PopupsAskViewModel.prototype.onShow = function (sAskDesc, fYesFunc, fNoFunc, sYesButton, sNoButton) + AskPopupView.prototype.onShow = function (sAskDesc, fYesFunc, fNoFunc, sYesButton, sNoButton) { this.clearPopup(); @@ -101,12 +101,12 @@ } }; - PopupsAskViewModel.prototype.onFocus = function () + AskPopupView.prototype.onFocus = function () { this.yesFocus(true); }; - PopupsAskViewModel.prototype.onBuild = function () + AskPopupView.prototype.onBuild = function () { key('tab, shift+tab, right, left', Enums.KeyState.PopupAsk, _.bind(function () { if (this.yesFocus()) @@ -126,6 +126,6 @@ }, this)); }; - module.exports = PopupsAskViewModel; + module.exports = AskPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsComposeViewModel.js b/dev/View/Popup/Compose.js similarity index 91% rename from dev/ViewModels/Popups/PopupsComposeViewModel.js rename to dev/View/Popup/Compose.js index 4a6fcb10d..6233641a5 100644 --- a/dev/ViewModels/Popups/PopupsComposeViewModel.js +++ b/dev/View/Popup/Compose.js @@ -20,24 +20,24 @@ LinkBuilder = require('Common/LinkBuilder'), HtmlEditor = require('Common/HtmlEditor'), - Settings = require('Storage:Settings'), - Data = require('Storage:RainLoop:Data'), - Cache = require('Storage:RainLoop:Cache'), - Remote = require('Storage:RainLoop:Remote'), + Settings = require('Storage/Settings'), + Data = require('Storage/App/Data'), + Cache = require('Storage/App/Cache'), + Remote = require('Storage/App/Remote'), ComposeAttachmentModel = require('Model/ComposeAttachment'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsComposeViewModel() + function ComposePopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsCompose'); + AbstractView.call(this, 'Popups', 'PopupsCompose'); this.oEditor = null; this.aDraftInfo = null; @@ -211,8 +211,8 @@ this.deleteCommand = Utils.createCommand(this, function () { - require('App:RainLoop').deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]); - kn.hideScreenPopup(PopupsComposeViewModel); + require('App/App').deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]); + kn.hideScreenPopup(ComposePopupView); }, function () { return this.isDraftFolderMessage(); @@ -248,7 +248,7 @@ if ('' === sSentFolder) { - kn.showScreenPopup(require('View:Popup:FolderSystem'), [Enums.SetSystemFoldersNotification.Sent]); + kn.showScreenPopup(require('View/Popup/FolderSystem'), [Enums.SetSystemFoldersNotification.Sent]); } else { @@ -270,7 +270,7 @@ } Cache.setMessageFlagsToCache(this.aDraftInfo[2], this.aDraftInfo[1], aFlagsCache); - require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache(); + require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache(); Cache.setFolderHash(this.aDraftInfo[2], ''); } } @@ -306,7 +306,7 @@ if (Data.draftFolderNotEnabled()) { - kn.showScreenPopup(require('View:Popup:FolderSystem'), [Enums.SetSystemFoldersNotification.Draft]); + kn.showScreenPopup(require('View/Popup/FolderSystem'), [Enums.SetSystemFoldersNotification.Draft]); } else { @@ -403,24 +403,24 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:Compose', 'PopupsComposeViewModel'], PopupsComposeViewModel); - _.extend(PopupsComposeViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/Compose', 'PopupsComposeViewModel'], ComposePopupView); + _.extend(ComposePopupView.prototype, AbstractView.prototype); - PopupsComposeViewModel.prototype.emailsSource = function (oData, fResponse) + ComposePopupView.prototype.emailsSource = function (oData, fResponse) { - require('App:RainLoop').getAutocomplete(oData.term, function (aData) { + require('App/App').getAutocomplete(oData.term, function (aData) { fResponse(_.map(aData, function (oEmailItem) { return oEmailItem.toLine(false); })); }); }; - PopupsComposeViewModel.prototype.openOpenPgpPopup = function () + ComposePopupView.prototype.openOpenPgpPopup = function () { if (this.capaOpenPGP() && this.oEditor && !this.oEditor.isHtml()) { var self = this; - kn.showScreenPopup(require('View:Popup:ComposeOpenPgp'), [ + kn.showScreenPopup(require('View/Popup/ComposeOpenPgp'), [ function (sResult) { self.editor(function (oEditor) { oEditor.setPlain(sResult); @@ -435,7 +435,7 @@ } }; - PopupsComposeViewModel.prototype.reloadDraftFolder = function () + ComposePopupView.prototype.reloadDraftFolder = function () { var sDraftFolder = Data.draftFolder() @@ -446,16 +446,16 @@ Cache.setFolderHash(sDraftFolder, ''); if (Data.currentFolderFullNameRaw() === sDraftFolder) { - require('App:RainLoop').reloadMessageList(true); + require('App/App').reloadMessageList(true); } else { - require('App:RainLoop').folderInformation(sDraftFolder); + require('App/App').folderInformation(sDraftFolder); } } }; - PopupsComposeViewModel.prototype.findIdentityIdByMessage = function (sComposeType, oMessage) + ComposePopupView.prototype.findIdentityIdByMessage = function (sComposeType, oMessage) { var oIDs = {}, @@ -511,7 +511,7 @@ return sResult; }; - PopupsComposeViewModel.prototype.selectIdentity = function (oIdentity) + ComposePopupView.prototype.selectIdentity = function (oIdentity) { if (oIdentity) { @@ -524,7 +524,7 @@ * @param {boolean=} bHeaderResult = false * @returns {string} */ - PopupsComposeViewModel.prototype.formattedFrom = function (bHeaderResult) + ComposePopupView.prototype.formattedFrom = function (bHeaderResult) { var sDisplayName = Data.displayName(), @@ -538,7 +538,7 @@ ; }; - PopupsComposeViewModel.prototype.sendMessageResponse = function (sResult, oData) + ComposePopupView.prototype.sendMessageResponse = function (sResult, oData) { var bResult = false, @@ -576,7 +576,7 @@ this.reloadDraftFolder(); }; - PopupsComposeViewModel.prototype.saveMessageResponse = function (sResult, oData) + ComposePopupView.prototype.saveMessageResponse = function (sResult, oData) { var bResult = false, @@ -630,7 +630,7 @@ this.reloadDraftFolder(); }; - PopupsComposeViewModel.prototype.onHide = function () + ComposePopupView.prototype.onHide = function () { this.reset(); kn.routeOn(); @@ -643,7 +643,7 @@ * @param {string=} sComposeType * @return {string} */ - PopupsComposeViewModel.prototype.convertSignature = function (sSignature, sFrom, sData, sComposeType) + ComposePopupView.prototype.convertSignature = function (sSignature, sFrom, sData, sComposeType) { var bHtml = false, bData = false; if ('' !== sSignature) @@ -698,7 +698,7 @@ return sSignature; }; - PopupsComposeViewModel.prototype.editor = function (fOnInit) + ComposePopupView.prototype.editor = function (fOnInit) { if (fOnInit) { @@ -727,7 +727,7 @@ * @param {string=} sCustomSubject = null * @param {string=} sCustomPlainText = null */ - PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToEmails, sCustomSubject, sCustomPlainText) + ComposePopupView.prototype.onShow = function (sType, oMessageOrArray, aToEmails, sCustomSubject, sCustomPlainText) { kn.routeOff(); @@ -990,7 +990,7 @@ this.triggerForResize(); }; - PopupsComposeViewModel.prototype.onFocus = function () + ComposePopupView.prototype.onFocus = function () { if ('' === this.to()) { @@ -1004,7 +1004,7 @@ this.triggerForResize(); }; - PopupsComposeViewModel.prototype.editorResize = function () + ComposePopupView.prototype.editorResize = function () { if (this.oEditor) { @@ -1012,11 +1012,11 @@ } }; - PopupsComposeViewModel.prototype.tryToClosePopup = function () + ComposePopupView.prototype.tryToClosePopup = function () { var self = this, - PopupsAskViewModel = require('View:Popup:Ask') + PopupsAskViewModel = require('View/Popup/Ask') ; if (!kn.isPopupVisible(PopupsAskViewModel)) @@ -1030,7 +1030,7 @@ } }; - PopupsComposeViewModel.prototype.onBuild = function () + ComposePopupView.prototype.onBuild = function () { this.initUploader(); @@ -1087,7 +1087,7 @@ } }; - PopupsComposeViewModel.prototype.driveCallback = function (sAccessToken, oData) + ComposePopupView.prototype.driveCallback = function (sAccessToken, oData) { if (oData && window.XMLHttpRequest && window.google && oData[window.google.picker.Response.ACTION] === window.google.picker.Action.PICKED && @@ -1155,7 +1155,7 @@ } }; - PopupsComposeViewModel.prototype.driveCreatePiker = function (oOauthToken) + ComposePopupView.prototype.driveCreatePiker = function (oOauthToken) { if (window.gapi && oOauthToken && oOauthToken.access_token) { @@ -1183,7 +1183,7 @@ } }; - PopupsComposeViewModel.prototype.driveOpenPopup = function () + ComposePopupView.prototype.driveOpenPopup = function () { if (window.gapi) { @@ -1238,7 +1238,7 @@ * @param {string} sId * @return {?Object} */ - PopupsComposeViewModel.prototype.getAttachmentById = function (sId) + ComposePopupView.prototype.getAttachmentById = function (sId) { var aAttachments = this.attachments(), @@ -1257,7 +1257,7 @@ return null; }; - PopupsComposeViewModel.prototype.initUploader = function () + ComposePopupView.prototype.initUploader = function () { if (this.composeUploaderButton()) { @@ -1445,7 +1445,7 @@ /** * @return {Object} */ - PopupsComposeViewModel.prototype.prepearAttachmentsForSendOrSave = function () + ComposePopupView.prototype.prepearAttachmentsForSendOrSave = function () { var oResult = {}; _.each(this.attachmentsInReady(), function (oItem) { @@ -1466,7 +1466,7 @@ /** * @param {MessageModel} oMessage */ - PopupsComposeViewModel.prototype.addMessageAsAttachment = function (oMessage) + ComposePopupView.prototype.addMessageAsAttachment = function (oMessage) { if (oMessage) { @@ -1500,7 +1500,7 @@ * @param {Object} oDropboxFile * @return {boolean} */ - PopupsComposeViewModel.prototype.addDropboxAttachment = function (oDropboxFile) + ComposePopupView.prototype.addDropboxAttachment = function (oDropboxFile) { var self = this, @@ -1562,7 +1562,7 @@ * @param {string} sAccessToken * @return {boolean} */ - PopupsComposeViewModel.prototype.addDriveAttachment = function (oDriveFile, sAccessToken) + ComposePopupView.prototype.addDriveAttachment = function (oDriveFile, sAccessToken) { var self = this, @@ -1624,7 +1624,7 @@ * @param {MessageModel} oMessage * @param {string} sType */ - PopupsComposeViewModel.prototype.prepearMessageAttachments = function (oMessage, sType) + ComposePopupView.prototype.prepearMessageAttachments = function (oMessage, sType) { if (oMessage) { @@ -1687,14 +1687,14 @@ } }; - PopupsComposeViewModel.prototype.removeLinkedAttachments = function () + ComposePopupView.prototype.removeLinkedAttachments = function () { this.attachments.remove(function (oItem) { return oItem && oItem.isLinked; }); }; - PopupsComposeViewModel.prototype.setMessageAttachmentFailedDowbloadText = function () + ComposePopupView.prototype.setMessageAttachmentFailedDowbloadText = function () { _.each(this.attachments(), function(oAttachment) { if (oAttachment && oAttachment.fromMessage) @@ -1712,7 +1712,7 @@ * @param {boolean=} bIncludeAttachmentInProgress = true * @return {boolean} */ - PopupsComposeViewModel.prototype.isEmptyForm = function (bIncludeAttachmentInProgress) + ComposePopupView.prototype.isEmptyForm = function (bIncludeAttachmentInProgress) { bIncludeAttachmentInProgress = Utils.isUnd(bIncludeAttachmentInProgress) ? true : !!bIncludeAttachmentInProgress; var bAttach = bIncludeAttachmentInProgress ? @@ -1727,7 +1727,7 @@ ; }; - PopupsComposeViewModel.prototype.reset = function () + ComposePopupView.prototype.reset = function () { this.to(''); this.cc(''); @@ -1770,7 +1770,7 @@ /** * @return {Array} */ - PopupsComposeViewModel.prototype.getAttachmentsDownloadsForUpload = function () + ComposePopupView.prototype.getAttachmentsDownloadsForUpload = function () { return _.map(_.filter(this.attachments(), function (oItem) { return oItem && '' === oItem.tempName(); @@ -1779,12 +1779,12 @@ }); }; - PopupsComposeViewModel.prototype.triggerForResize = function () + ComposePopupView.prototype.triggerForResize = function () { this.resizer(!this.resizer()); this.editorResizeThrottle(); }; - module.exports = PopupsComposeViewModel; + module.exports = ComposePopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js b/dev/View/Popup/ComposeOpenPgp.js similarity index 83% rename from dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js rename to dev/View/Popup/ComposeOpenPgp.js index 1de6a3f43..2fbadc588 100644 --- a/dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js +++ b/dev/View/Popup/ComposeOpenPgp.js @@ -11,21 +11,21 @@ Utils = require('Common/Utils'), Enums = require('Common/Enums'), - Data = require('Storage:RainLoop:Data'), + Data = require('Storage/App/Data'), EmailModel = require('Model/Email'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsComposeOpenPgpViewModel() + function ComposeOpenPgpPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsComposeOpenPgp'); + AbstractView.call(this, 'Popups', 'PopupsComposeOpenPgp'); this.notification = ko.observable(''); @@ -157,10 +157,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:ComposeOpenPgp', 'PopupsComposeOpenPgpViewModel'], PopupsComposeOpenPgpViewModel); - _.extend(PopupsComposeOpenPgpViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/ComposeOpenPgp', 'PopupsComposeOpenPgpViewModel'], ComposeOpenPgpPopupView); + _.extend(ComposeOpenPgpPopupView.prototype, AbstractView.prototype); - PopupsComposeOpenPgpViewModel.prototype.clearPopup = function () + ComposeOpenPgpPopupView.prototype.clearPopup = function () { this.notification(''); @@ -177,7 +177,7 @@ this.resultCallback = null; }; - PopupsComposeOpenPgpViewModel.prototype.onBuild = function () + ComposeOpenPgpPopupView.prototype.onBuild = function () { key('tab,shift+tab', Enums.KeyState.PopupComposeOpenPGP, _.bind(function () { @@ -196,12 +196,12 @@ }, this)); }; - PopupsComposeOpenPgpViewModel.prototype.onHide = function () + ComposeOpenPgpPopupView.prototype.onHide = function () { this.clearPopup(); }; - PopupsComposeOpenPgpViewModel.prototype.onFocus = function () + ComposeOpenPgpPopupView.prototype.onFocus = function () { if (this.sign()) { @@ -213,7 +213,7 @@ } }; - PopupsComposeOpenPgpViewModel.prototype.onShow = function (fCallback, sText, sFromEmail, sTo, sCc, sBcc) + ComposeOpenPgpPopupView.prototype.onShow = function (fCallback, sText, sFromEmail, sTo, sCc, sBcc) { this.clearPopup(); @@ -259,6 +259,6 @@ this.text(sText); }; - module.exports = PopupsComposeOpenPgpViewModel; + module.exports = ComposeOpenPgpPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsContactsViewModel.js b/dev/View/Popup/Contacts.js similarity index 87% rename from dev/ViewModels/Popups/PopupsContactsViewModel.js rename to dev/View/Popup/Contacts.js index b7449d4aa..7d26e03ce 100644 --- a/dev/ViewModels/Popups/PopupsContactsViewModel.js +++ b/dev/View/Popup/Contacts.js @@ -17,25 +17,25 @@ Selector = require('Common/Selector'), LinkBuilder = require('Common/LinkBuilder'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote'), + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote'), EmailModel = require('Model/Email'), ContactModel = require('Model/Contact'), ContactTagModel = require('Model/ContactTag'), ContactPropertyModel = require('Model/ContactProperty'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsContactsViewModel() + function ContactsPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsContacts'); + AbstractView.call(this, 'Popups', 'PopupsContacts'); var self = this, @@ -277,8 +277,8 @@ if (Utils.isNonEmptyArray(aE)) { - kn.hideScreenPopup(require('View:Popup:Contacts')); - kn.showScreenPopup(require('View:Popup:Compose'), [Enums.ComposeType.Empty, null, aE]); + kn.hideScreenPopup(require('View/Popup/Contacts')); + kn.showScreenPopup(require('View/Popup/Compose'), [Enums.ComposeType.Empty, null, aE]); } }, function () { @@ -349,7 +349,7 @@ this.syncCommand = Utils.createCommand(this, function () { var self = this; - require('App:RainLoop').contactsSync(function (sResult, oData) { + require('App/App').contactsSync(function (sResult, oData) { if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result) { window.alert(Utils.getNotification( @@ -390,19 +390,19 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:Contacts', 'PopupsContactsViewModel'], PopupsContactsViewModel); - _.extend(PopupsContactsViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/Contacts', 'PopupsContactsViewModel'], ContactsPopupView); + _.extend(ContactsPopupView.prototype, AbstractView.prototype); - PopupsContactsViewModel.prototype.contactTagsSource = function (oData, fResponse) + ContactsPopupView.prototype.contactTagsSource = function (oData, fResponse) { - require('App:RainLoop').getContactTagsAutocomplete(oData.term, function (aData) { + require('App/App').getContactTagsAutocomplete(oData.term, function (aData) { fResponse(_.map(aData, function (oTagItem) { return oTagItem.toLine(false); })); }); }; - PopupsContactsViewModel.prototype.getPropertyPlceholder = function (sType) + ContactsPopupView.prototype.getPropertyPlceholder = function (sType) { var sResult = ''; switch (sType) @@ -421,12 +421,12 @@ return sResult; }; - PopupsContactsViewModel.prototype.addNewProperty = function (sType, sTypeStr) + ContactsPopupView.prototype.addNewProperty = function (sType, sTypeStr) { this.viewProperties.push(new ContactPropertyModel(sType, sTypeStr || '', '', true, this.getPropertyPlceholder(sType))); }; - PopupsContactsViewModel.prototype.addNewOrFocusProperty = function (sType, sTypeStr) + ContactsPopupView.prototype.addNewOrFocusProperty = function (sType, sTypeStr) { var oItem = _.find(this.viewProperties(), function (oItem) { return sType === oItem.type(); @@ -442,53 +442,53 @@ } }; - PopupsContactsViewModel.prototype.addNewTag = function () + ContactsPopupView.prototype.addNewTag = function () { this.viewTags.visibility(true); this.viewTags.focusTrigger(true); }; - PopupsContactsViewModel.prototype.addNewEmail = function () + ContactsPopupView.prototype.addNewEmail = function () { this.addNewProperty(Enums.ContactPropertyType.Email, 'Home'); }; - PopupsContactsViewModel.prototype.addNewPhone = function () + ContactsPopupView.prototype.addNewPhone = function () { this.addNewProperty(Enums.ContactPropertyType.Phone, 'Mobile'); }; - PopupsContactsViewModel.prototype.addNewWeb = function () + ContactsPopupView.prototype.addNewWeb = function () { this.addNewProperty(Enums.ContactPropertyType.Web); }; - PopupsContactsViewModel.prototype.addNewNickname = function () + ContactsPopupView.prototype.addNewNickname = function () { this.addNewOrFocusProperty(Enums.ContactPropertyType.Nick); }; - PopupsContactsViewModel.prototype.addNewNotes = function () + ContactsPopupView.prototype.addNewNotes = function () { this.addNewOrFocusProperty(Enums.ContactPropertyType.Note); }; - PopupsContactsViewModel.prototype.addNewBirthday = function () + ContactsPopupView.prototype.addNewBirthday = function () { this.addNewOrFocusProperty(Enums.ContactPropertyType.Birthday); }; - PopupsContactsViewModel.prototype.exportVcf = function () + ContactsPopupView.prototype.exportVcf = function () { - require('App:RainLoop').download(LinkBuilder.exportContactsVcf()); + require('App/App').download(LinkBuilder.exportContactsVcf()); }; - PopupsContactsViewModel.prototype.exportCsv = function () + ContactsPopupView.prototype.exportCsv = function () { - require('App:RainLoop').download(LinkBuilder.exportContactsCsv()); + require('App/App').download(LinkBuilder.exportContactsCsv()); }; - PopupsContactsViewModel.prototype.initUploader = function () + ContactsPopupView.prototype.initUploader = function () { if (this.importUploaderButton()) { @@ -528,7 +528,7 @@ } }; - PopupsContactsViewModel.prototype.removeCheckedOrSelectedContactsFromList = function () + ContactsPopupView.prototype.removeCheckedOrSelectedContactsFromList = function () { var self = this, @@ -567,7 +567,7 @@ } }; - PopupsContactsViewModel.prototype.deleteSelectedContacts = function () + ContactsPopupView.prototype.deleteSelectedContacts = function () { if (0 < this.contactsCheckedOrSelected().length) { @@ -584,7 +584,7 @@ * @param {string} sResult * @param {AjaxJsonDefaultResponse} oData */ - PopupsContactsViewModel.prototype.deleteResponse = function (sResult, oData) + ContactsPopupView.prototype.deleteResponse = function (sResult, oData) { if (500 < (Enums.StorageResultType.Success === sResult && oData && oData.Time ? Utils.pInt(oData.Time) : 0)) { @@ -600,7 +600,7 @@ } }; - PopupsContactsViewModel.prototype.removeProperty = function (oProp) + ContactsPopupView.prototype.removeProperty = function (oProp) { this.viewProperties.remove(oProp); }; @@ -608,7 +608,7 @@ /** * @param {?ContactModel} oContact */ - PopupsContactsViewModel.prototype.populateViewContact = function (oContact) + ContactsPopupView.prototype.populateViewContact = function (oContact) { var sId = '', @@ -672,7 +672,7 @@ /** * @param {boolean=} bDropPagePosition = false */ - PopupsContactsViewModel.prototype.reloadContactList = function (bDropPagePosition) + ContactsPopupView.prototype.reloadContactList = function (bDropPagePosition) { var self = this, @@ -732,7 +732,7 @@ }, iOffset, Consts.Defaults.ContactsPerPage, this.search()); }; - PopupsContactsViewModel.prototype.onBuild = function (oDom) + ContactsPopupView.prototype.onBuild = function (oDom) { this.oContentVisible = $('.b-list-content', oDom); this.oContentScrollable = $('.content', this.oContentVisible); @@ -760,13 +760,13 @@ this.initUploader(); }; - PopupsContactsViewModel.prototype.onShow = function () + ContactsPopupView.prototype.onShow = function () { kn.routeOff(); this.reloadContactList(true); }; - PopupsContactsViewModel.prototype.onHide = function () + ContactsPopupView.prototype.onHide = function () { kn.routeOn(); this.currentContact(null); @@ -776,6 +776,6 @@ this.contacts([]); }; - module.exports = PopupsContactsViewModel; + module.exports = ContactsPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsDomainViewModel.js b/dev/View/Popup/Domain.js similarity index 88% rename from dev/ViewModels/Popups/PopupsDomainViewModel.js rename to dev/View/Popup/Domain.js index 19713affb..e9bb4448c 100644 --- a/dev/ViewModels/Popups/PopupsDomainViewModel.js +++ b/dev/View/Popup/Domain.js @@ -11,19 +11,19 @@ Consts = require('Common/Consts'), Utils = require('Common/Utils'), - Remote = require('Storage:Admin:Remote'), + Remote = require('Storage/Admin/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsDomainViewModel() + function DomainPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsDomain'); + AbstractView.call(this, 'Popups', 'PopupsDomain'); this.edit = ko.observable(false); this.saving = ko.observable(false); @@ -199,10 +199,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:Domain', 'PopupsDomainViewModel'], PopupsDomainViewModel); - _.extend(PopupsDomainViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/Domain', 'PopupsDomainViewModel'], DomainPopupView); + _.extend(DomainPopupView.prototype, AbstractView.prototype); - PopupsDomainViewModel.prototype.onTestConnectionResponse = function (sResult, oData) + DomainPopupView.prototype.onTestConnectionResponse = function (sResult, oData) { this.testing(false); if (Enums.StorageResultType.Success === sResult && oData.Result) @@ -228,14 +228,14 @@ } }; - PopupsDomainViewModel.prototype.onDomainCreateOrSaveResponse = function (sResult, oData) + DomainPopupView.prototype.onDomainCreateOrSaveResponse = function (sResult, oData) { this.saving(false); if (Enums.StorageResultType.Success === sResult && oData) { if (oData.Result) { - require('App:Admin').reloadDomainList(); + require('App/Admin').reloadDomainList(); this.closeCommand(); } else if (Enums.Notification.DomainAlreadyExists === oData.ErrorCode) @@ -249,12 +249,12 @@ } }; - PopupsDomainViewModel.prototype.onHide = function () + DomainPopupView.prototype.onHide = function () { this.whiteListPage(false); }; - PopupsDomainViewModel.prototype.onShow = function (oDomain) + DomainPopupView.prototype.onShow = function (oDomain) { this.saving(false); this.whiteListPage(false); @@ -283,7 +283,7 @@ } }; - PopupsDomainViewModel.prototype.onFocus = function () + DomainPopupView.prototype.onFocus = function () { if ('' === this.name()) { @@ -291,7 +291,7 @@ } }; - PopupsDomainViewModel.prototype.clearForm = function () + DomainPopupView.prototype.clearForm = function () { this.edit(false); this.whiteListPage(false); @@ -313,6 +313,6 @@ this.whiteList(''); }; - module.exports = PopupsDomainViewModel; + module.exports = DomainPopupView; }()); \ No newline at end of file diff --git a/dev/View/Popup/Filter.js b/dev/View/Popup/Filter.js new file mode 100644 index 000000000..444c94ad3 --- /dev/null +++ b/dev/View/Popup/Filter.js @@ -0,0 +1,53 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + ko = require('ko'), + + Consts = require('Common/Consts'), + Utils = require('Common/Utils'), + + Data = require('Storage/App/Data'), + + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') + ; + + /** + * @constructor + * @extends AbstractView + */ + function FilterPopupView() + { + AbstractView.call(this, 'Popups', 'PopupsFilter'); + + this.filter = ko.observable(null); + + this.selectedFolderValue = ko.observable(Consts.Values.UnuseOptionValue); + this.folderSelectList = Data.folderMenuForMove; + this.defautOptionsAfterRender = Utils.defautOptionsAfterRender; + + kn.constructorEnd(this); + } + + kn.extendAsViewModel(['View/Popup/Filter', 'PopupsFilterViewModel'], FilterPopupView); + _.extend(FilterPopupView.prototype, AbstractView.prototype); + + FilterPopupView.prototype.clearPopup = function () + { + // TODO + }; + + FilterPopupView.prototype.onShow = function (oFilter) + { + this.clearPopup(); + + this.filter(oFilter); + }; + + module.exports = FilterPopupView; + +}()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsFolderClearViewModel.js b/dev/View/Popup/FolderClear.js similarity index 72% rename from dev/ViewModels/Popups/PopupsFolderClearViewModel.js rename to dev/View/Popup/FolderClear.js index 449dffb9d..57d716984 100644 --- a/dev/ViewModels/Popups/PopupsFolderClearViewModel.js +++ b/dev/View/Popup/FolderClear.js @@ -10,21 +10,21 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Data = require('Storage:RainLoop:Data'), - Cache = require('Storage:RainLoop:Cache'), - Remote = require('Storage:RainLoop:Remote'), + Data = require('Storage/App/Data'), + Cache = require('Storage/App/Cache'), + Remote = require('Storage/App/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsFolderClearViewModel() + function FolderClearPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFolderClear'); + AbstractView.call(this, 'Popups', 'PopupsFolderClear'); this.selectedFolder = ko.observable(null); this.clearingProcess = ko.observable(false); @@ -70,7 +70,7 @@ self.clearingProcess(false); if (Enums.StorageResultType.Success === sResult && oData && oData.Result) { - require('App:RainLoop').reloadMessageList(true); + require('App/App').reloadMessageList(true); self.cancelCommand(); } else @@ -101,16 +101,16 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:FolderClear', 'PopupsFolderClearViewModel'], PopupsFolderClearViewModel); - _.extend(PopupsFolderClearViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/FolderClear', 'PopupsFolderClearViewModel'], FolderClearPopupView); + _.extend(FolderClearPopupView.prototype, AbstractView.prototype); - PopupsFolderClearViewModel.prototype.clearPopup = function () + FolderClearPopupView.prototype.clearPopup = function () { this.clearingProcess(false); this.selectedFolder(null); }; - PopupsFolderClearViewModel.prototype.onShow = function (oFolder) + FolderClearPopupView.prototype.onShow = function (oFolder) { this.clearPopup(); if (oFolder) @@ -119,6 +119,6 @@ } }; - module.exports = PopupsFolderClearViewModel; + module.exports = FolderClearPopupView; }()); diff --git a/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js b/dev/View/Popup/FolderCreate.js similarity index 71% rename from dev/ViewModels/Popups/PopupsFolderCreateViewModel.js rename to dev/View/Popup/FolderCreate.js index a2bfec538..255026366 100644 --- a/dev/ViewModels/Popups/PopupsFolderCreateViewModel.js +++ b/dev/View/Popup/FolderCreate.js @@ -11,20 +11,20 @@ Consts = require('Common/Consts'), Utils = require('Common/Utils'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote'), + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsFolderCreateViewModel() + function FolderCreateView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFolderCreate'); + AbstractView.call(this, 'Popups', 'PopupsFolderCreate'); Utils.initOnStartOrLangChange(function () { this.sNoParentText = Utils.i18n('POPUPS_CREATE_FOLDER/SELECT_NO_PARENT'); @@ -79,7 +79,7 @@ Data.foldersCreating(false); if (Enums.StorageResultType.Success === sResult && oData && oData.Result) { - require('App:RainLoop').folders(); + require('App/App').folders(); } else { @@ -100,33 +100,33 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:FolderCreate', 'PopupsFolderCreateViewModel'], PopupsFolderCreateViewModel); - _.extend(PopupsFolderCreateViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/FolderCreate', 'PopupsFolderCreateViewModel'], FolderCreateView); + _.extend(FolderCreateView.prototype, AbstractView.prototype); - PopupsFolderCreateViewModel.prototype.sNoParentText = ''; + FolderCreateView.prototype.sNoParentText = ''; - PopupsFolderCreateViewModel.prototype.simpleFolderNameValidation = function (sName) + FolderCreateView.prototype.simpleFolderNameValidation = function (sName) { return (/^[^\\\/]+$/g).test(Utils.trim(sName)); }; - PopupsFolderCreateViewModel.prototype.clearPopup = function () + FolderCreateView.prototype.clearPopup = function () { this.folderName(''); this.selectedParentValue(''); this.folderName.focused(false); }; - PopupsFolderCreateViewModel.prototype.onShow = function () + FolderCreateView.prototype.onShow = function () { this.clearPopup(); }; - PopupsFolderCreateViewModel.prototype.onFocus = function () + FolderCreateView.prototype.onFocus = function () { this.folderName.focused(true); }; - module.exports = PopupsFolderCreateViewModel; + module.exports = FolderCreateView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsFolderSystemViewModel.js b/dev/View/Popup/FolderSystem.js similarity index 80% rename from dev/ViewModels/Popups/PopupsFolderSystemViewModel.js rename to dev/View/Popup/FolderSystem.js index 9c8dca18f..e78ce425d 100644 --- a/dev/ViewModels/Popups/PopupsFolderSystemViewModel.js +++ b/dev/View/Popup/FolderSystem.js @@ -11,21 +11,21 @@ Consts = require('Common/Consts'), Utils = require('Common/Utils'), - Settings = require('Storage:Settings'), - Data = require('Storage:RainLoop:Data'), - Remote = require('Storage:RainLoop:Remote'), + Settings = require('Storage/Settings'), + Data = require('Storage/App/Data'), + Remote = require('Storage/App/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsFolderSystemViewModel() + function FolderSystemPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFolderSystem'); + AbstractView.call(this, 'Popups', 'PopupsFolderSystem'); Utils.initOnStartOrLangChange(function () { this.sChooseOnText = Utils.i18n('POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE'); @@ -94,16 +94,16 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:FolderSystem', 'PopupsFolderSystemViewModel'], PopupsFolderSystemViewModel); - _.extend(PopupsFolderSystemViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/FolderSystem', 'PopupsFolderSystemViewModel'], FolderSystemPopupView); + _.extend(FolderSystemPopupView.prototype, AbstractView.prototype); - PopupsFolderSystemViewModel.prototype.sChooseOnText = ''; - PopupsFolderSystemViewModel.prototype.sUnuseText = ''; + FolderSystemPopupView.prototype.sChooseOnText = ''; + FolderSystemPopupView.prototype.sUnuseText = ''; /** * @param {number=} iNotificationType = Enums.SetSystemFoldersNotification.None */ - PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType) + FolderSystemPopupView.prototype.onShow = function (iNotificationType) { var sNotification = ''; @@ -131,6 +131,6 @@ this.notification(sNotification); }; - module.exports = PopupsFolderSystemViewModel; + module.exports = FolderSystemPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsIdentityViewModel.js b/dev/View/Popup/Identity.js similarity index 79% rename from dev/ViewModels/Popups/PopupsIdentityViewModel.js rename to dev/View/Popup/Identity.js index 6e3f823fc..406fbb079 100644 --- a/dev/ViewModels/Popups/PopupsIdentityViewModel.js +++ b/dev/View/Popup/Identity.js @@ -10,20 +10,20 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Remote = require('Storage:RainLoop:Remote'), - Data = require('Storage:RainLoop:Data'), + Remote = require('Storage/App/Remote'), + Data = require('Storage/App/Data'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsIdentityViewModel() + function IdentityPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsIdentity'); + AbstractView.call(this, 'Popups', 'PopupsIdentity'); this.id = ''; this.edit = ko.observable(false); @@ -83,7 +83,7 @@ { if (oData.Result) { - require('App:RainLoop').accountsAndIdentities(); + require('App/App').accountsAndIdentities(); this.cancelCommand(); } else if (oData.ErrorCode) @@ -115,10 +115,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:Identity', 'PopupsIdentityViewModel'], PopupsIdentityViewModel); - _.extend(PopupsIdentityViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/Identity', 'PopupsIdentityViewModel'], IdentityPopupView); + _.extend(IdentityPopupView.prototype, AbstractView.prototype); - PopupsIdentityViewModel.prototype.clearPopup = function () + IdentityPopupView.prototype.clearPopup = function () { this.id = ''; this.edit(false); @@ -140,7 +140,7 @@ /** * @param {?IdentityModel} oIdentity */ - PopupsIdentityViewModel.prototype.onShow = function (oIdentity) + IdentityPopupView.prototype.onShow = function (oIdentity) { this.clearPopup(); @@ -158,7 +158,7 @@ } }; - PopupsIdentityViewModel.prototype.onFocus = function () + IdentityPopupView.prototype.onFocus = function () { if (!this.owner()) { @@ -166,6 +166,6 @@ } }; - module.exports = PopupsIdentityViewModel; + module.exports = IdentityPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js b/dev/View/Popup/KeyboardShortcutsHelp.js similarity index 59% rename from dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js rename to dev/View/Popup/KeyboardShortcutsHelp.js index f28200b11..511e3a400 100644 --- a/dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js +++ b/dev/View/Popup/KeyboardShortcutsHelp.js @@ -9,27 +9,27 @@ Enums = require('Common/Enums'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsKeyboardShortcutsHelpViewModel() + function KeyboardShortcutsHelpPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsKeyboardShortcutsHelp'); + AbstractView.call(this, 'Popups', 'PopupsKeyboardShortcutsHelp'); this.sDefaultKeyScope = Enums.KeyState.PopupKeyboardShortcutsHelp; kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:KeyboardShortcutsHelp', 'PopupsKeyboardShortcutsHelpViewModel'], PopupsKeyboardShortcutsHelpViewModel); - _.extend(PopupsKeyboardShortcutsHelpViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/KeyboardShortcutsHelp', 'PopupsKeyboardShortcutsHelpViewModel'], KeyboardShortcutsHelpPopupView); + _.extend(KeyboardShortcutsHelpPopupView.prototype, AbstractView.prototype); - PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom) + KeyboardShortcutsHelpPopupView.prototype.onBuild = function (oDom) { key('tab, shift+tab, left, right', Enums.KeyState.PopupKeyboardShortcutsHelp, _.bind(function (event, handler) { if (event && handler) @@ -59,6 +59,6 @@ }, this)); }; - module.exports = PopupsKeyboardShortcutsHelpViewModel; + module.exports = KeyboardShortcutsHelpPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsLanguagesViewModel.js b/dev/View/Popup/Languages.js similarity index 56% rename from dev/ViewModels/Popups/PopupsLanguagesViewModel.js rename to dev/View/Popup/Languages.js index 89750be23..9762c06aa 100644 --- a/dev/ViewModels/Popups/PopupsLanguagesViewModel.js +++ b/dev/View/Popup/Languages.js @@ -10,17 +10,17 @@ Utils = require('Common/Utils'), Globals = require('Common/Globals'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsLanguagesViewModel() + function LanguagesPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsLanguages'); + AbstractView.call(this, 'Popups', 'PopupsLanguages'); this.Data = Globals.__APP__.data(); // TODO @@ -43,15 +43,15 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:Languages', 'PopupsLanguagesViewModel'], PopupsLanguagesViewModel); - _.extend(PopupsLanguagesViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/Languages', 'PopupsLanguagesViewModel'], LanguagesPopupView); + _.extend(LanguagesPopupView.prototype, AbstractView.prototype); - PopupsLanguagesViewModel.prototype.languageEnName = function (sLanguage) + LanguagesPopupView.prototype.languageEnName = function (sLanguage) { return Utils.convertLangName(sLanguage, true); }; - PopupsLanguagesViewModel.prototype.resetMainLanguage = function () + LanguagesPopupView.prototype.resetMainLanguage = function () { var sCurrent = this.Data.mainLanguage(); _.each(this.languages(), function (oItem) { @@ -59,24 +59,24 @@ }); }; - PopupsLanguagesViewModel.prototype.onShow = function () + LanguagesPopupView.prototype.onShow = function () { this.exp(true); this.resetMainLanguage(); }; - PopupsLanguagesViewModel.prototype.onHide = function () + LanguagesPopupView.prototype.onHide = function () { this.exp(false); }; - PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang) + LanguagesPopupView.prototype.changeLanguage = function (sLang) { this.Data.mainLanguage(sLang); this.cancelCommand(); }; - module.exports = PopupsLanguagesViewModel; + module.exports = LanguagesPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsNewOpenPgpKeyViewModel.js b/dev/View/Popup/NewOpenPgpKey.js similarity index 70% rename from dev/ViewModels/Popups/PopupsNewOpenPgpKeyViewModel.js rename to dev/View/Popup/NewOpenPgpKey.js index dc6394044..d8f2e4831 100644 --- a/dev/ViewModels/Popups/PopupsNewOpenPgpKeyViewModel.js +++ b/dev/View/Popup/NewOpenPgpKey.js @@ -9,19 +9,19 @@ Utils = require('Common/Utils'), - Data = require('Storage:RainLoop:Data'), + Data = require('Storage/App/Data'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsNewOpenPgpKeyViewModel() + function NewOpenPgpKeyPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsNewOpenPgpKey'); + AbstractView.call(this, 'Popups', 'PopupsNewOpenPgpKey'); this.email = ko.observable(''); this.email.focus = ko.observable(''); @@ -74,7 +74,7 @@ oOpenpgpKeyring.publicKeys.importKey(mKeyPair.publicKeyArmored); oOpenpgpKeyring.store(); - require('App:RainLoop').reloadOpenPgpKeys(); + require('App/App').reloadOpenPgpKeys(); Utils.delegateRun(self, 'cancelCommand'); } @@ -87,10 +87,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:NewOpenPgpKey', 'PopupsNewOpenPgpKeyViewModel'], PopupsNewOpenPgpKeyViewModel); - _.extend(PopupsNewOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/NewOpenPgpKey', 'PopupsNewOpenPgpKeyViewModel'], NewOpenPgpKeyPopupView); + _.extend(NewOpenPgpKeyPopupView.prototype, AbstractView.prototype); - PopupsNewOpenPgpKeyViewModel.prototype.clearPopup = function () + NewOpenPgpKeyPopupView.prototype.clearPopup = function () { this.name(''); this.password(''); @@ -100,16 +100,16 @@ this.keyBitLength(2048); }; - PopupsNewOpenPgpKeyViewModel.prototype.onShow = function () + NewOpenPgpKeyPopupView.prototype.onShow = function () { this.clearPopup(); }; - PopupsNewOpenPgpKeyViewModel.prototype.onFocus = function () + NewOpenPgpKeyPopupView.prototype.onFocus = function () { this.email.focus(true); }; - module.exports = PopupsNewOpenPgpKeyViewModel; + module.exports = NewOpenPgpKeyPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsPluginViewModel.js b/dev/View/Popup/Plugin.js similarity index 77% rename from dev/ViewModels/Popups/PopupsPluginViewModel.js rename to dev/View/Popup/Plugin.js index 24c181b0d..fcd9533ae 100644 --- a/dev/ViewModels/Popups/PopupsPluginViewModel.js +++ b/dev/View/Popup/Plugin.js @@ -11,19 +11,19 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Remote = require('Storage:Admin:Remote'), + Remote = require('Storage/Admin/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsPluginViewModel() + function PluginPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsPlugin'); + AbstractView.call(this, 'Popups', 'PopupsPlugin'); var self = this; @@ -84,10 +84,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:Plugin', 'PopupsPluginViewModel'], PopupsPluginViewModel); - _.extend(PopupsPluginViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/Plugin', 'PopupsPluginViewModel'], PluginPopupView); + _.extend(PluginPopupView.prototype, AbstractView.prototype); - PopupsPluginViewModel.prototype.onPluginSettingsUpdateResponse = function (sResult, oData) + PluginPopupView.prototype.onPluginSettingsUpdateResponse = function (sResult, oData) { if (Enums.StorageResultType.Success === sResult && oData && oData.Result) { @@ -107,7 +107,7 @@ } }; - PopupsPluginViewModel.prototype.onShow = function (oPlugin) + PluginPopupView.prototype.onShow = function (oPlugin) { this.name(); this.readme(); @@ -135,11 +135,11 @@ } }; - PopupsPluginViewModel.prototype.tryToClosePopup = function () + PluginPopupView.prototype.tryToClosePopup = function () { var self = this, - PopupsAskViewModel = require('View:Popup:Ask') + PopupsAskViewModel = require('View/Popup/Ask') ; if (!kn.isPopupVisible(PopupsAskViewModel)) @@ -153,7 +153,7 @@ } }; - PopupsPluginViewModel.prototype.onBuild = function () + PluginPopupView.prototype.onBuild = function () { key('esc', Enums.KeyState.All, _.bind(function () { if (this.modalVisibility()) @@ -164,6 +164,6 @@ }, this)); }; - module.exports = PopupsPluginViewModel; + module.exports = PluginPopupView; }()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js b/dev/View/Popup/TwoFactorTest.js similarity index 56% rename from dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js rename to dev/View/Popup/TwoFactorTest.js index cd6edf5f7..235f008f4 100644 --- a/dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js +++ b/dev/View/Popup/TwoFactorTest.js @@ -10,19 +10,19 @@ Enums = require('Common/Enums'), Utils = require('Common/Utils'), - Remote = require('Storage:RainLoop:Remote'), + Remote = require('Storage/App/Remote'), - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') ; /** * @constructor - * @extends KnoinAbstractViewModel + * @extends AbstractView */ - function PopupsTwoFactorTestViewModel() + function TwoFactorTestPopupView() { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsTwoFactorTest'); + AbstractView.call(this, 'Popups', 'PopupsTwoFactorTest'); var self = this; @@ -50,10 +50,10 @@ kn.constructorEnd(this); } - kn.extendAsViewModel(['View:Popup:TwoFactorTest', 'PopupsTwoFactorTestViewModel'], PopupsTwoFactorTestViewModel); - _.extend(PopupsTwoFactorTestViewModel.prototype, KnoinAbstractViewModel.prototype); + kn.extendAsViewModel(['View/Popup/TwoFactorTest', 'PopupsTwoFactorTestViewModel'], TwoFactorTestPopupView); + _.extend(TwoFactorTestPopupView.prototype, AbstractView.prototype); - PopupsTwoFactorTestViewModel.prototype.clearPopup = function () + TwoFactorTestPopupView.prototype.clearPopup = function () { this.code(''); this.code.focused(false); @@ -61,16 +61,16 @@ this.testing(false); }; - PopupsTwoFactorTestViewModel.prototype.onShow = function () + TwoFactorTestPopupView.prototype.onShow = function () { this.clearPopup(); }; - PopupsTwoFactorTestViewModel.prototype.onFocus = function () + TwoFactorTestPopupView.prototype.onFocus = function () { this.code.focused(true); }; - module.exports = PopupsTwoFactorTestViewModel; + module.exports = TwoFactorTestPopupView; }()); \ No newline at end of file diff --git a/dev/View/Popup/ViewOpenPgpKey.js b/dev/View/Popup/ViewOpenPgpKey.js new file mode 100644 index 000000000..93f65a94b --- /dev/null +++ b/dev/View/Popup/ViewOpenPgpKey.js @@ -0,0 +1,59 @@ + +(function () { + + 'use strict'; + + var + _ = require('_'), + ko = require('ko'), + + Utils = require('Common/Utils'), + + kn = require('Knoin/Knoin'), + AbstractView = require('Knoin/AbstractView') + ; + + /** + * @constructor + * @extends AbstractView + */ + function ViewOpenPgpKeyPopupView() + { + AbstractView.call(this, 'Popups', 'PopupsViewOpenPgpKey'); + + this.key = ko.observable(''); + this.keyDom = ko.observable(null); + + kn.constructorEnd(this); + } + + kn.extendAsViewModel(['View/Popup/ViewOpenPgpKey', 'PopupsViewOpenPgpKeyViewModel'], ViewOpenPgpKeyPopupView); + _.extend(ViewOpenPgpKeyPopupView.prototype, AbstractView.prototype); + + ViewOpenPgpKeyPopupView.prototype.clearPopup = function () + { + this.key(''); + }; + + ViewOpenPgpKeyPopupView.prototype.selectKey = function () + { + var oEl = this.keyDom(); + if (oEl) + { + Utils.selectElement(oEl); + } + }; + + ViewOpenPgpKeyPopupView.prototype.onShow = function (oOpenPgpKey) + { + this.clearPopup(); + + if (oOpenPgpKey) + { + this.key(oOpenPgpKey.armor); + } + }; + + module.exports = ViewOpenPgpKeyPopupView; + +}()); \ No newline at end of file diff --git a/dev/ViewModels/AboutViewModel.js b/dev/ViewModels/AboutViewModel.js deleted file mode 100644 index 52eea8a1a..000000000 --- a/dev/ViewModels/AboutViewModel.js +++ /dev/null @@ -1,34 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - ko = require('ko'), - - kn = require('App:Knoin'), - Settings = require('Storage:Settings'), - - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') - ; - - /** - * @constructor - * @extends KnoinAbstractViewModel - */ - function AboutViewModel() - { - KnoinAbstractViewModel.call(this, 'Center', 'About'); - - this.version = ko.observable(Settings.settingsGet('Version')); - - kn.constructorEnd(this); - } - - kn.extendAsViewModel(['View:RainLoop:About', 'AboutViewModel'], AboutViewModel); - _.extend(AboutViewModel.prototype, KnoinAbstractViewModel.prototype); - - module.exports = AboutViewModel; - -}()); \ No newline at end of file diff --git a/dev/ViewModels/AdminSettingsMenuViewModel.js b/dev/ViewModels/AdminSettingsMenuViewModel.js deleted file mode 100644 index 59a4ba430..000000000 --- a/dev/ViewModels/AdminSettingsMenuViewModel.js +++ /dev/null @@ -1,42 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - - Globals = require('Common/Globals'), - - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') - ; - - /** - * @param {?} oScreen - * - * @constructor - * @extends KnoinAbstractViewModel - */ - function AdminSettingsMenuViewModel(oScreen) - { - KnoinAbstractViewModel.call(this, 'Left', 'AdminMenu'); - - this.leftPanelDisabled = Globals.leftPanelDisabled; - - this.menu = oScreen.menu; - - kn.constructorEnd(this); - } - - kn.extendAsViewModel(['View:Admin:SettingsMenu', 'AdminSettingsMenuViewModel'], AdminSettingsMenuViewModel); - _.extend(AdminSettingsMenuViewModel.prototype, KnoinAbstractViewModel.prototype); - - AdminSettingsMenuViewModel.prototype.link = function (sRoute) - { - return '#/' + sRoute; - }; - - module.exports = AdminSettingsMenuViewModel; - -}()); diff --git a/dev/ViewModels/AdminSettingsPaneViewModel.js b/dev/ViewModels/AdminSettingsPaneViewModel.js deleted file mode 100644 index 7dc933a61..000000000 --- a/dev/ViewModels/AdminSettingsPaneViewModel.js +++ /dev/null @@ -1,46 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - ko = require('ko'), - - Settings = require('Storage:Settings'), - Data = require('Storage:Admin:Data'), - Remote = require('Storage:Admin:Remote'), - - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') - ; - - /** - * @constructor - * @extends KnoinAbstractViewModel - */ - function AdminSettingsPaneViewModel() - { - KnoinAbstractViewModel.call(this, 'Right', 'AdminPane'); - - this.adminDomain = ko.observable(Settings.settingsGet('AdminDomain')); - this.version = ko.observable(Settings.settingsGet('Version')); - - this.adminManLoadingVisibility = Data.adminManLoadingVisibility; - - kn.constructorEnd(this); - } - - kn.extendAsViewModel(['View:Admin:SettingsPane', 'AdminSettingsPaneViewModel'], AdminSettingsPaneViewModel); - _.extend(AdminSettingsPaneViewModel.prototype, KnoinAbstractViewModel.prototype); - - AdminSettingsPaneViewModel.prototype.logoutClick = function () - { - Remote.adminLogout(function () { - require('App:Admin').loginAndLogoutReload(); - }); - }; - - module.exports = AdminSettingsPaneViewModel; - -}()); \ No newline at end of file diff --git a/dev/ViewModels/MailBoxSystemDropDownViewModel.js b/dev/ViewModels/MailBoxSystemDropDownViewModel.js deleted file mode 100644 index 09d715b7e..000000000 --- a/dev/ViewModels/MailBoxSystemDropDownViewModel.js +++ /dev/null @@ -1,28 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - - kn = require('App:Knoin'), - AbstractSystemDropDownViewModel = require('View:RainLoop:AbstractSystemDropDown') - ; - - /** - * @constructor - * @extends AbstractSystemDropDownViewModel - */ - function MailBoxSystemDropDownViewModel() - { - AbstractSystemDropDownViewModel.call(this); - kn.constructorEnd(this); - } - - kn.extendAsViewModel(['View:RainLoop:MailBoxSystemDropDown', 'MailBoxSystemDropDownViewModel'], MailBoxSystemDropDownViewModel); - _.extend(MailBoxSystemDropDownViewModel.prototype, AbstractSystemDropDownViewModel.prototype); - - module.exports = MailBoxSystemDropDownViewModel; - -}()); diff --git a/dev/ViewModels/Popups/PopupsFilterViewModel.js b/dev/ViewModels/Popups/PopupsFilterViewModel.js deleted file mode 100644 index 999ecac69..000000000 --- a/dev/ViewModels/Popups/PopupsFilterViewModel.js +++ /dev/null @@ -1,53 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - ko = require('ko'), - - Consts = require('Common/Consts'), - Utils = require('Common/Utils'), - - Data = require('Storage:RainLoop:Data'), - - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') - ; - - /** - * @constructor - * @extends KnoinAbstractViewModel - */ - function PopupsFilterViewModel() - { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFilter'); - - this.filter = ko.observable(null); - - this.selectedFolderValue = ko.observable(Consts.Values.UnuseOptionValue); - this.folderSelectList = Data.folderMenuForMove; - this.defautOptionsAfterRender = Utils.defautOptionsAfterRender; - - kn.constructorEnd(this); - } - - kn.extendAsViewModel(['View:Popup:Filter', 'PopupsFilterViewModel'], PopupsFilterViewModel); - _.extend(PopupsFilterViewModel.prototype, KnoinAbstractViewModel.prototype); - - PopupsFilterViewModel.prototype.clearPopup = function () - { - // TODO - }; - - PopupsFilterViewModel.prototype.onShow = function (oFilter) - { - this.clearPopup(); - - this.filter(oFilter); - }; - - module.exports = PopupsFilterViewModel; - -}()); \ No newline at end of file diff --git a/dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js b/dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js deleted file mode 100644 index f97330e25..000000000 --- a/dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js +++ /dev/null @@ -1,59 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - ko = require('ko'), - - Utils = require('Common/Utils'), - - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') - ; - - /** - * @constructor - * @extends KnoinAbstractViewModel - */ - function PopupsViewOpenPgpKeyViewModel() - { - KnoinAbstractViewModel.call(this, 'Popups', 'PopupsViewOpenPgpKey'); - - this.key = ko.observable(''); - this.keyDom = ko.observable(null); - - kn.constructorEnd(this); - } - - kn.extendAsViewModel(['View:Popup:ViewOpenPgpKey', 'PopupsViewOpenPgpKeyViewModel'], PopupsViewOpenPgpKeyViewModel); - _.extend(PopupsViewOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype); - - PopupsViewOpenPgpKeyViewModel.prototype.clearPopup = function () - { - this.key(''); - }; - - PopupsViewOpenPgpKeyViewModel.prototype.selectKey = function () - { - var oEl = this.keyDom(); - if (oEl) - { - Utils.selectElement(oEl); - } - }; - - PopupsViewOpenPgpKeyViewModel.prototype.onShow = function (oOpenPgpKey) - { - this.clearPopup(); - - if (oOpenPgpKey) - { - this.key(oOpenPgpKey.armor); - } - }; - - module.exports = PopupsViewOpenPgpKeyViewModel; - -}()); \ No newline at end of file diff --git a/dev/ViewModels/SettingsMenuViewModel.js b/dev/ViewModels/SettingsMenuViewModel.js deleted file mode 100644 index eeb4b6f90..000000000 --- a/dev/ViewModels/SettingsMenuViewModel.js +++ /dev/null @@ -1,48 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - - Globals = require('Common/Globals'), - LinkBuilder = require('Common/LinkBuilder'), - - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') - ; - - /** - * @param {?} oScreen - * - * @constructor - * @extends KnoinAbstractViewModel - */ - function SettingsMenuViewModel(oScreen) - { - KnoinAbstractViewModel.call(this, 'Left', 'SettingsMenu'); - - this.leftPanelDisabled = Globals.leftPanelDisabled; - - this.menu = oScreen.menu; - - kn.constructorEnd(this); - } - - kn.extendAsViewModel(['View:RainLoop:SettingsMenu', 'SettingsMenuViewModel'], SettingsMenuViewModel); - _.extend(SettingsMenuViewModel.prototype, KnoinAbstractViewModel.prototype); - - SettingsMenuViewModel.prototype.link = function (sRoute) - { - return LinkBuilder.settings(sRoute); - }; - - SettingsMenuViewModel.prototype.backToMailBoxClick = function () - { - kn.setHash(LinkBuilder.inbox()); - }; - - module.exports = SettingsMenuViewModel; - -}()); \ No newline at end of file diff --git a/dev/ViewModels/SettingsPaneViewModel.js b/dev/ViewModels/SettingsPaneViewModel.js deleted file mode 100644 index b48720613..000000000 --- a/dev/ViewModels/SettingsPaneViewModel.js +++ /dev/null @@ -1,53 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - key = require('key'), - - Enums = require('Common/Enums'), - LinkBuilder = require('Common/LinkBuilder'), - - Data = require('Storage:RainLoop:Data'), - - kn = require('App:Knoin'), - KnoinAbstractViewModel = require('Knoin:AbstractViewModel') - ; - - /** - * @constructor - * @extends KnoinAbstractViewModel - */ - function SettingsPaneViewModel() - { - KnoinAbstractViewModel.call(this, 'Right', 'SettingsPane'); - - kn.constructorEnd(this); - } - - kn.extendAsViewModel(['View:RainLoop:SettingsPane', 'SettingsPaneViewModel'], SettingsPaneViewModel); - _.extend(SettingsPaneViewModel.prototype, KnoinAbstractViewModel.prototype); - - SettingsPaneViewModel.prototype.onBuild = function () - { - var self = this; - key('esc', Enums.KeyState.Settings, function () { - self.backToMailBoxClick(); - }); - }; - - SettingsPaneViewModel.prototype.onShow = function () - { - Data.message(null); - }; - - SettingsPaneViewModel.prototype.backToMailBoxClick = function () - { - kn.setHash(LinkBuilder.inbox()); - }; - - module.exports = SettingsPaneViewModel; - -}()); \ No newline at end of file diff --git a/dev/ViewModels/SettingsSystemDropDownViewModel.js b/dev/ViewModels/SettingsSystemDropDownViewModel.js deleted file mode 100644 index 7c8adf4c4..000000000 --- a/dev/ViewModels/SettingsSystemDropDownViewModel.js +++ /dev/null @@ -1,28 +0,0 @@ - -(function () { - - 'use strict'; - - var - _ = require('_'), - - kn = require('App:Knoin'), - AbstractSystemDropDownViewModel = require('View:RainLoop:AbstractSystemDropDown') - ; - - /** - * @constructor - * @extends AbstractSystemDropDownViewModel - */ - function SettingsSystemDropDownViewModel() - { - AbstractSystemDropDownViewModel.call(this); - kn.constructorEnd(this); - } - - kn.extendAsViewModel(['View:RainLoop:SettingsSystemDropDown', 'SettingsSystemDropDownViewModel'], SettingsSystemDropDownViewModel); - _.extend(SettingsSystemDropDownViewModel.prototype, AbstractSystemDropDownViewModel.prototype); - - module.exports = SettingsSystemDropDownViewModel; - -}()); \ No newline at end of file diff --git a/dev/admin.js b/dev/admin.js new file mode 100644 index 000000000..41533dd74 --- /dev/null +++ b/dev/admin.js @@ -0,0 +1 @@ +require('App/Boot')(require('App/Admin')); \ No newline at end of file diff --git a/dev/app.js b/dev/app.js new file mode 100644 index 000000000..10451577b --- /dev/null +++ b/dev/app.js @@ -0,0 +1 @@ +require('App/Boot')(require('App/App')); \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index e70c409e6..9b7aea96a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -68,6 +68,7 @@ function renameFileWothMd5Hash(sFile) } cfg.paths.globjs = 'dev/**/*.js'; +cfg.paths.static = 'rainloop/v/' + cfg.devVersion + '/static/'; cfg.paths.staticJS = 'rainloop/v/' + cfg.devVersion + '/static/js/'; cfg.paths.staticMinJS = 'rainloop/v/' + cfg.devVersion + '/static/js/min/'; cfg.paths.staticCSS = 'rainloop/v/' + cfg.devVersion + '/static/css/'; @@ -238,6 +239,16 @@ gulp.task('js:libs', ['js:encrypt'], function() { .pipe(gulp.dest(cfg.paths.staticMinJS)); }); +gulp.task('js:ckeditor:beautify', function() { + var beautify = require('gulp-beautify'); + return gulp.src(cfg.paths.static + 'ckeditor/ckeditor.js') + .pipe(beautify({ + 'indentSize': 2 + })) + .pipe(rename('ckeditor.beautify.js')) + .pipe(gulp.dest(cfg.paths.static + 'ckeditor/')); +}); + gulp.task('js:webpack:clear', function() { return gulp.src([cfg.paths.staticJS + '*.chunk.js', cfg.paths.staticMinJS + '*.chunk.js'], {read: false}) .pipe(require('gulp-rimraf')()); diff --git a/package.json b/package.json index e88dc6e28..5b9f39d03 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "RainLoop", "title": "RainLoop Webmail", "version": "1.6.9", - "release": "163", + "release": "165", "description": "Simple, modern & fast web-based email client", "homepage": "http://rainloop.net", "main": "gulpfile.js", @@ -36,7 +36,7 @@ "plugins" ], "readmeFilename": "README.md", - "ownCloudPackageVersion": "2.1", + "ownCloudPackageVersion": "2.2", "engines": { "node": ">= 0.10.0" }, @@ -63,6 +63,7 @@ "gulp-csscomb": "*", "gulp-closure-compiler": "*", "gulp-csslint": "*", + "gulp-beautify": "*", "gulp-concat-util": "*" } } diff --git a/plugins/recaptcha/js/recaptcha.js b/plugins/recaptcha/js/recaptcha.js index 742ee9444..cbda2d216 100644 --- a/plugins/recaptcha/js/recaptcha.js +++ b/plugins/recaptcha/js/recaptcha.js @@ -41,7 +41,9 @@ $(function () { 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 (!bStarted && oViewModel && + ('View:RainLoop:Login' === sName || 'View/App/Login' === sName || 'LoginViewModel' === sName || 'LoginAppView' === sName) && + window.rl.pluginSettingsGet('recaptcha', 'show_captcha_on_login')) { bStarted = true; StartRecaptcha(); diff --git a/plugins/snowfall-on-login-screen/js/include.js b/plugins/snowfall-on-login-screen/js/include.js index 4d6c80df8..7598b9820 100644 --- a/plugins/snowfall-on-login-screen/js/include.js +++ b/plugins/snowfall-on-login-screen/js/include.js @@ -1,6 +1,6 @@ $(function () { - if (window.snowFall && !window.rl.settingsGet('Auth')) + if (window.snowFall && window.rl && !window.rl.settingsGet('Auth')) { var sUserAgent = (navigator.userAgent || '').toLowerCase(), diff --git a/rainloop/v/0.0.0/static/ckeditor/ckeditor.js b/rainloop/v/0.0.0/static/ckeditor/ckeditor.js index ec43784e0..5c973fee7 100644 --- a/rainloop/v/0.0.0/static/ckeditor/ckeditor.js +++ b/rainloop/v/0.0.0/static/ckeditor/ckeditor.js @@ -62,7 +62,7 @@ if(b){if(a)for(;a=e.firstChild;)b.insertBefore(e.removeChild(a),e);b.removeChild this.getLast());){if(a.type==CKEDITOR.NODE_TEXT){var e=CKEDITOR.tools.rtrim(a.getText()),b=a.getLength();if(e){if(e.length8)&&e)a=e+":"+a;return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},getHead:function(){var a=this.$.getElementsByTagName("head")[0]; @@ -318,7 +318,8 @@ b=CKEDITOR.dom.element.createFromHtml(h.output({id:a.id,name:b,langDir:a.lang.di a.container=b;j&&a.ui.space("top").unselectable();l&&a.ui.space("bottom").unselectable();d=a.config.width;e=a.config.height;d&&b.setStyle("width",CKEDITOR.tools.cssLength(d));e&&a.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(e));b.disableContextMenu();CKEDITOR.env.webkit&&b.on("focus",function(){a.focus()});a.fireOnce("uiReady")}CKEDITOR.replace=function(b,e){return a(b,e,null,CKEDITOR.ELEMENT_MODE_REPLACE)};CKEDITOR.appendTo=function(b,e,d){return a(b,e,d,CKEDITOR.ELEMENT_MODE_APPENDTO)}; CKEDITOR.replaceAll=function(){for(var a=document.getElementsByTagName("textarea"),b=0;b=46&&a<=90||a>=96&&a<=111||a>=186&&a<=222||a==229)&&b()}});a.document.on("drop",b);a.document.getBody().on("drop",b)});a.on("mode",function(){if(a.mode=="source"){var c=a.textarea||a._.editable;c.on("keydown",function(a){!a.data.$.ctrlKey&&!a.data.$.metaKey&&b()});c.on("drop",b);c.on("input",b);if(CKEDITOR.env.ie){c.on("cut",b);c.on("paste",b)}}})}});CKEDITOR.plugins.add("removeformat",{init:function(a){a.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat);a.ui.addButton&&a.ui.addButton("RemoveFormat",{label:a.lang.removeformat.toolbar,command:"removeFormat",toolbar:"cleanup,10"})}}); CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(a){for(var h=a._.removeFormatRegex||(a._.removeFormatRegex=RegExp("^(?:"+a.config.removeFormatTags.replace(/,/g,"|")+")$","i")),e=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),f=CKEDITOR.plugins.removeformat.filter,k=a.getSelection().getRanges(),l=k.createIterator(),m=function(a){return a.type==CKEDITOR.NODE_ELEMENT},c;c=l.getNextRange();){c.collapsed||c.enlarge(CKEDITOR.ENLARGE_ELEMENT); var j=c.createBookmark(),b=j.startNode,d=j.endNode,i=function(b){for(var c=a.elementPath(b),e=c.elements,d=1,g;(g=e[d])&&!g.equals(c.block)&&!g.equals(c.blockLimit);d++)h.test(g.getName())&&f(a,g)&&b.breakParent(g)};i(b);if(d){i(d);for(b=b.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);b&&!b.equals(d);)if(b.isReadOnly()){if(b.getPosition(d)&CKEDITOR.POSITION_CONTAINS)break;b=b.getNext(m)}else i=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),!("img"==b.getName()&&b.data("cke-realelement"))&&f(a,b)&&(h.test(b.getName())? diff --git a/rainloop/v/0.0.0/static/ckeditor/ckeditor.original.js b/rainloop/v/0.0.0/static/ckeditor/ckeditor.original.js new file mode 100644 index 000000000..ec43784e0 --- /dev/null +++ b/rainloop/v/0.0.0/static/ckeditor/ckeditor.original.js @@ -0,0 +1,899 @@ +/* +Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.md or http://ckeditor.com/license +*/ +(function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,e={timestamp:"E7KD",version:"4.4.4",revision:"1ba5105",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var f=window.CKEDITOR_BASEPATH||"";if(!f)for(var d=document.getElementsByTagName("script"),c=0;c=0;y--)if(n[y].priority<=e){n.splice(y+1,0,l);return{removeListener:h}}n.unshift(l)}return{removeListener:h}}, +once:function(){var a=arguments[1];arguments[1]=function(f){f.removeListener();return a.apply(this,arguments)};return this.on.apply(this,arguments)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,f=function(){a=1},d=0,b=function(){d=1};return function(j,l,h){var n=e(this)[j],j=a,t=d;a=d=0;if(n){var y=n.listeners;if(y.length)for(var y=y.slice(0),z,o=0;o=0&&d.listeners.splice(b,1)}},removeAllListeners:function(){var a=e(this),f;for(f in a)delete a[f]},hasListeners:function(a){return(a=e(this)[a])&&a.listeners.length>0}}}()); +CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]);CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=function(a,e){a in{instanceReady:1,loaded:1}&&(this[a]=true);return CKEDITOR.event.prototype.fire.call(this,a,e,this)},CKEDITOR.editor.prototype.fireOnce=function(a,e){a in{instanceReady:1,loaded:1}&&(this[a]=true);return CKEDITOR.event.prototype.fireOnce.call(this,a,e,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)); +CKEDITOR.env||(CKEDITOR.env=function(){var a=navigator.userAgent.toLowerCase(),e={ie:a.indexOf("trident/")>-1,webkit:a.indexOf(" applewebkit/")>-1,air:a.indexOf(" adobeair/")>-1,mac:a.indexOf("macintosh")>-1,quirks:document.compatMode=="BackCompat"&&(!document.documentMode||document.documentMode<10),mobile:a.indexOf("mobile")>-1,iOS:/(ipad|iphone|ipod)/.test(a),isCustomDomain:function(){if(!this.ie)return false;var a=document.domain,d=window.location.hostname;return a!=d&&a!="["+d+"]"},secure:location.protocol== +"https:"};e.gecko=navigator.product=="Gecko"&&!e.webkit&&!e.ie;if(e.webkit)a.indexOf("chrome")>-1?e.chrome=true:e.safari=true;var b=0;if(e.ie){b=e.quirks||!document.documentMode?parseFloat(a.match(/msie (\d+)/)[1]):document.documentMode;e.ie9Compat=b==9;e.ie8Compat=b==8;e.ie7Compat=b==7;e.ie6Compat=b<7||e.quirks}if(e.gecko){var c=a.match(/rv:([\d\.]+)/);if(c){c=c[1].split(".");b=c[0]*1E4+(c[1]||0)*100+(c[2]||0)*1}}e.air&&(b=parseFloat(a.match(/ adobeair\/(\d+)/)[1]));e.webkit&&(b=parseFloat(a.match(/ applewebkit\/(\d+)/)[1])); +e.version=b;e.isCompatible=e.iOS&&b>=534||!e.mobile&&(e.ie&&b>6||e.gecko&&b>=2E4||e.air&&b>=1||e.webkit&&b>=522||false);e.hidpi=window.devicePixelRatio>=2;e.needsBrFiller=e.gecko||e.webkit||e.ie&&b>10;e.needsNbspFiller=e.ie&&b<11;e.cssClass="cke_browser_"+(e.ie?"ie":e.gecko?"gecko":e.webkit?"webkit":"unknown");if(e.quirks)e.cssClass=e.cssClass+" cke_browser_quirks";if(e.ie)e.cssClass=e.cssClass+(" cke_browser_ie"+(e.quirks?"6 cke_browser_iequirks":e.version));if(e.air)e.cssClass=e.cssClass+" cke_browser_air"; +if(e.iOS)e.cssClass=e.cssClass+" cke_browser_ios";if(e.hidpi)e.cssClass=e.cssClass+" cke_hidpi";return e}()); +"unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR);CKEDITOR.loadFullCore=function(){if(CKEDITOR.status!="basic_ready")CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var a=document.createElement("script");a.type="text/javascript";a.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(a)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(a){(this._.pending||(this._.pending=[])).push(a)};(function(){CKEDITOR.domReady(function(){var a= +CKEDITOR.loadFullCore,e=CKEDITOR.loadFullCoreTimeout;if(a){CKEDITOR.status="basic_ready";a&&a._load?a():e&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},e*1E3)}})})();CKEDITOR.status="basic_loaded"}();CKEDITOR.dom={}; +(function(){var a=[],e=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",b=/&/g,c=/>/g,f=/"+f+""):d.push('');return d.join("")}, +htmlEncode:function(a){return(""+a).replace(b,"&").replace(c,">").replace(f,"<")},htmlDecode:function(a){return a.replace(g,"&").replace(j,">").replace(l,"<")},htmlEncodeAttr:function(a){return a.replace(d,""").replace(f,"<").replace(c,">")},htmlDecodeAttr:function(a){return a.replace(h,'"').replace(l,"<").replace(j,">")},getNextNumber:function(){var a=0;return function(){return++a}}(),getNextId:function(){return"cke_"+this.getNextNumber()},override:function(a,f){var d=f(a);d.prototype= +a.prototype;return d},setTimeout:function(a,f,d,b,c){c||(c=window);d||(d=c);return c.setTimeout(function(){b?a.apply(d,[].concat(b)):a.apply(d)},f||0)},trim:function(){var a=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(f){return f.replace(a,"")}}(),ltrim:function(){var a=/^[ \t\n\r]+/g;return function(f){return f.replace(a,"")}}(),rtrim:function(){var a=/[ \t\n\r]+$/g;return function(f){return f.replace(a,"")}}(),indexOf:function(a,f){if(typeof f=="function")for(var d=0,b=a.length;d=0?a[d]:null},bind:function(a,f){return function(){return a.apply(f,arguments)}},createClass:function(a){var f=a.$,d=a.base,b=a.privates||a._,c=a.proto,a=a.statics;!f&&(f=function(){d&&this.base.apply(this,arguments)});if(b)var e=f,f=function(){var a=this._||(this._={}),f;for(f in b){var d=b[f];a[f]=typeof d=="function"?CKEDITOR.tools.bind(d,this):d}e.apply(this,arguments)};if(d){f.prototype= +this.prototypedCopy(d.prototype);f.prototype.constructor=f;f.base=d;f.baseProto=d.prototype;f.prototype.base=function(){this.base=d.prototype.base;d.apply(this,arguments);this.base=arguments.callee}}c&&this.extend(f.prototype,c,true);a&&this.extend(f,a,true);return f},addFunction:function(f,d){return a.push(function(){return f.apply(d||this,arguments)})-1},removeFunction:function(f){a[f]=null},callFunction:function(f){var d=a[f];return d&&d.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var a= +/^-?\d+\.?\d*px$/,f;return function(d){f=CKEDITOR.tools.trim(d+"")+"px";return a.test(f)?f:d||""}}(),convertToPx:function(){var a;return function(f){if(!a){a=CKEDITOR.dom.element.createFromHtml('
',CKEDITOR.document);CKEDITOR.document.getBody().append(a)}if(!/%$/.test(f)){a.setStyle("width",f);return a.$.clientWidth}return f}}(),repeat:function(a,f){return Array(f+1).join(a)},tryThese:function(){for(var a, +f=0,d=arguments.length;f8)&&e)a=e+":"+a;return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},getHead:function(){var a=this.$.getElementsByTagName("head")[0]; +return a=a?new CKEDITOR.dom.element(a):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),true)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(a){this.$.open("text/html","replace");CKEDITOR.env.ie&&(a=a.replace(/(?:^\s*]*?>)|^/i,'$&\n