Code refactoring

Fixed owncloud password encoder/decoder (#291)
Fixed ckeditor in ownCloud iframe (Closes #302)
Release commit
This commit is contained in:
RainLoop Team 2014-09-06 01:44:29 +04:00
parent 7a374ebe03
commit 06274c6a7c
112 changed files with 2667 additions and 1862 deletions

View file

@ -49,7 +49,7 @@ class OC_RainLoop_Helper
if (function_exists('mcrypt_encrypt') && function_exists('mcrypt_create_iv') && function_exists('mcrypt_get_iv_size') && 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')) 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)))); 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') && 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')) defined('MCRYPT_RIJNDAEL_256') && defined('MCRYPT_MODE_ECB') && defined('MCRYPT_RAND'))
{ {
return @mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($sSalt), base64_decode(trim($sPassword)), 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)); MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
} }
return @base64_decode(trim($sPassword)); return @base64_decode(trim($sPassword));

View file

@ -1,4 +0,0 @@
(function (require) {
'use strict';
require('App:Boot')(require('App:Admin'));
}(require));

View file

@ -13,19 +13,19 @@
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Events = require('Common/Events'), Events = require('Common/Events'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
KnoinAbstractBoot = require('Knoin:AbstractBoot') AbstractBoot = require('Knoin/AbstractBoot')
; ;
/** /**
* @constructor * @constructor
* @param {RemoteStorage|AdminRemoteStorage} Remote * @param {RemoteStorage|AdminRemoteStorage} Remote
* @extends KnoinAbstractBoot * @extends AbstractBoot
*/ */
function AbstractApp(Remote) function AbstractApp(Remote)
{ {
KnoinAbstractBoot.call(this); AbstractBoot.call(this);
this.isLocalAutocomplete = true; this.isLocalAutocomplete = true;
@ -62,7 +62,7 @@
}); });
} }
_.extend(AbstractApp.prototype, KnoinAbstractBoot.prototype); _.extend(AbstractApp.prototype, AbstractBoot.prototype);
AbstractApp.prototype.remote = function () AbstractApp.prototype.remote = function ()
{ {
@ -136,7 +136,7 @@
AbstractApp.prototype.loginAndLogoutReload = function (bLogout, bClose) AbstractApp.prototype.loginAndLogoutReload = function (bLogout, bClose)
{ {
var var
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
sCustomLogoutLink = Utils.pString(Settings.settingsGet('CustomLogoutLink')), sCustomLogoutLink = Utils.pString(Settings.settingsGet('CustomLogoutLink')),
bInIframe = !!Settings.settingsGet('InIframe') bInIframe = !!Settings.settingsGet('InIframe')
; ;

View file

@ -12,15 +12,12 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:Admin:Data'), Data = require('Storage/Admin/Data'),
Remote = require('Storage:Admin:Remote'), Remote = require('Storage/Admin/Remote'),
AdminSettingsScreen = require('Screen:Admin:Settings'), kn = require('Knoin/Knoin'),
AdminLoginScreen = require('Screen:Admin:Login'), AbstractApp = require('App/Abstract')
kn = require('App:Knoin'),
AbstractApp = require('App:Abstract')
; ;
/** /**
@ -254,11 +251,15 @@
{ {
if (!!Settings.settingsGet('Auth')) if (!!Settings.settingsGet('Auth'))
{ {
kn.startScreens([AdminSettingsScreen]); kn.startScreens([
require('Screen/Admin/Settings')
]);
} }
else else
{ {
kn.startScreens([AdminLoginScreen]); kn.startScreens([
require('Screen/Admin/Login')
]);
} }
} }

View file

@ -17,13 +17,13 @@
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Events = require('Common/Events'), Events = require('Common/Events'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
Local = require('Storage:LocalStorage'), Local = require('Storage/Local'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Cache = require('Storage:RainLoop:Cache'), Cache = require('Storage/App/Cache'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
EmailModel = require('Model/Email'), EmailModel = require('Model/Email'),
FolderModel = require('Model/Folder'), FolderModel = require('Model/Folder'),
@ -32,14 +32,14 @@
IdentityModel = require('Model/Identity'), IdentityModel = require('Model/Identity'),
OpenPgpKeyModel = require('Model/OpenPgpKey'), OpenPgpKeyModel = require('Model/OpenPgpKey'),
AbstractApp = require('App:Abstract') AbstractApp = require('App/Abstract')
; ;
/** /**
* @constructor * @constructor
* @extends AbstractApp * @extends AbstractApp
*/ */
function RainLoopApp() function AppApp()
{ {
AbstractApp.call(this, Remote); AbstractApp.call(this, Remote);
@ -102,19 +102,19 @@
this.socialUsers = _.bind(this.socialUsers, this); 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; return Remote;
}; };
RainLoopApp.prototype.data = function () AppApp.prototype.data = function ()
{ {
return Data; return Data;
}; };
RainLoopApp.prototype.reloadFlagsCurrentMessageListAndMessageFromCache = function () AppApp.prototype.reloadFlagsCurrentMessageListAndMessageFromCache = function ()
{ {
_.each(Data.messageList(), function (oMessage) { _.each(Data.messageList(), function (oMessage) {
Cache.initMessageFlagsFromCache(oMessage); Cache.initMessageFlagsFromCache(oMessage);
@ -127,7 +127,7 @@
* @param {boolean=} bDropPagePosition = false * @param {boolean=} bDropPagePosition = false
* @param {boolean=} bDropCurrenFolderCache = false * @param {boolean=} bDropCurrenFolderCache = false
*/ */
RainLoopApp.prototype.reloadMessageList = function (bDropPagePosition, bDropCurrenFolderCache) AppApp.prototype.reloadMessageList = function (bDropPagePosition, bDropCurrenFolderCache)
{ {
var var
self = this, self = this,
@ -171,12 +171,12 @@
}, Data.currentFolderFullNameRaw(), iOffset, Data.messagesPerPage(), Data.messageListSearch()); }, Data.currentFolderFullNameRaw(), iOffset, Data.messagesPerPage(), Data.messageListSearch());
}; };
RainLoopApp.prototype.recacheInboxMessageList = function () AppApp.prototype.recacheInboxMessageList = function ()
{ {
Remote.messageList(Utils.emptyFunction, 'INBOX', 0, Data.messagesPerPage(), '', true); Remote.messageList(Utils.emptyFunction, 'INBOX', 0, Data.messagesPerPage(), '', true);
}; };
RainLoopApp.prototype.reloadMessageListHelper = function (bEmptyList) AppApp.prototype.reloadMessageListHelper = function (bEmptyList)
{ {
this.reloadMessageList(bEmptyList); this.reloadMessageList(bEmptyList);
}; };
@ -185,7 +185,7 @@
* @param {Function} fResultFunc * @param {Function} fResultFunc
* @returns {boolean} * @returns {boolean}
*/ */
RainLoopApp.prototype.contactsSync = function (fResultFunc) AppApp.prototype.contactsSync = function (fResultFunc)
{ {
var oContacts = Data.contacts; var oContacts = Data.contacts;
if (oContacts.importing() || oContacts.syncing() || !Data.enableContactsSync() || !Data.allowContactsSync()) if (oContacts.importing() || oContacts.syncing() || !Data.enableContactsSync() || !Data.allowContactsSync())
@ -208,7 +208,7 @@
return true; return true;
}; };
RainLoopApp.prototype.messagesMoveTrigger = function () AppApp.prototype.messagesMoveTrigger = function ()
{ {
var var
self = this, self = this,
@ -229,7 +229,7 @@
this.oMoveCache = {}; this.oMoveCache = {};
}; };
RainLoopApp.prototype.messagesMoveHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForMove) AppApp.prototype.messagesMoveHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForMove)
{ {
var sH = '$$' + sFromFolderFullNameRaw + '$$' + sToFolderFullNameRaw + '$$'; var sH = '$$' + sFromFolderFullNameRaw + '$$' + sToFolderFullNameRaw + '$$';
if (!this.oMoveCache[sH]) if (!this.oMoveCache[sH])
@ -245,7 +245,7 @@
this.messagesMoveTrigger(); this.messagesMoveTrigger();
}; };
RainLoopApp.prototype.messagesCopyHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForCopy) AppApp.prototype.messagesCopyHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForCopy)
{ {
Remote.messagesCopy( Remote.messagesCopy(
this.moveOrDeleteResponseHelper, this.moveOrDeleteResponseHelper,
@ -255,7 +255,7 @@
); );
}; };
RainLoopApp.prototype.messagesDeleteHelper = function (sFromFolderFullNameRaw, aUidForRemove) AppApp.prototype.messagesDeleteHelper = function (sFromFolderFullNameRaw, aUidForRemove)
{ {
Remote.messagesDelete( Remote.messagesDelete(
this.moveOrDeleteResponseHelper, 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()) if (Enums.StorageResultType.Success === sResult && Data.currentFolder())
{ {
@ -292,7 +292,7 @@
* @param {string} sFromFolderFullNameRaw * @param {string} sFromFolderFullNameRaw
* @param {Array} aUidForRemove * @param {Array} aUidForRemove
*/ */
RainLoopApp.prototype.deleteMessagesFromFolderWithoutCheck = function (sFromFolderFullNameRaw, aUidForRemove) AppApp.prototype.deleteMessagesFromFolderWithoutCheck = function (sFromFolderFullNameRaw, aUidForRemove)
{ {
this.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove); this.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove);
Data.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove); Data.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove);
@ -304,7 +304,7 @@
* @param {Array} aUidForRemove * @param {Array} aUidForRemove
* @param {boolean=} bUseFolder = true * @param {boolean=} bUseFolder = true
*/ */
RainLoopApp.prototype.deleteMessagesFromFolder = function (iDeleteType, sFromFolderFullNameRaw, aUidForRemove, bUseFolder) AppApp.prototype.deleteMessagesFromFolder = function (iDeleteType, sFromFolderFullNameRaw, aUidForRemove, bUseFolder)
{ {
var var
self = this, self = this,
@ -344,12 +344,12 @@
if (!oMoveFolder && bUseFolder) if (!oMoveFolder && bUseFolder)
{ {
kn.showScreenPopup(require('View:Popup:FolderSystem'), [nSetSystemFoldersNotification]); kn.showScreenPopup(require('View/Popup/FolderSystem'), [nSetSystemFoldersNotification]);
} }
else if (!bUseFolder || (Enums.FolderType.Trash === iDeleteType && else if (!bUseFolder || (Enums.FolderType.Trash === iDeleteType &&
(sFromFolderFullNameRaw === Data.spamFolder() || sFromFolderFullNameRaw === Data.trashFolder()))) (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); self.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove);
Data.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove); Data.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove);
@ -369,7 +369,7 @@
* @param {string} sToFolderFullNameRaw * @param {string} sToFolderFullNameRaw
* @param {boolean=} bCopy = false * @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) if (sFromFolderFullNameRaw !== sToFolderFullNameRaw && Utils.isArray(aUidForMove) && 0 < aUidForMove.length)
{ {
@ -400,7 +400,7 @@
/** /**
* @param {Function=} fCallback * @param {Function=} fCallback
*/ */
RainLoopApp.prototype.folders = function (fCallback) AppApp.prototype.folders = function (fCallback)
{ {
Data.foldersLoading(true); Data.foldersLoading(true);
Remote.folders(_.bind(function (sResult, oData) { Remote.folders(_.bind(function (sResult, oData) {
@ -424,7 +424,7 @@
}, this)); }, this));
}; };
RainLoopApp.prototype.reloadOpenPgpKeys = function () AppApp.prototype.reloadOpenPgpKeys = function ()
{ {
if (Data.capaOpenPGP()) if (Data.capaOpenPGP())
{ {
@ -467,7 +467,7 @@
} }
}; };
RainLoopApp.prototype.accountsAndIdentities = function () AppApp.prototype.accountsAndIdentities = function ()
{ {
Data.accountsLoading(true); Data.accountsLoading(true);
Data.identitiesLoading(true); Data.identitiesLoading(true);
@ -514,7 +514,7 @@
}); });
}; };
RainLoopApp.prototype.quota = function () AppApp.prototype.quota = function ()
{ {
Remote.quota(function (sResult, oData) { Remote.quota(function (sResult, oData) {
if (Enums.StorageResultType.Success === sResult && oData && oData.Result && if (Enums.StorageResultType.Success === sResult && oData && oData.Result &&
@ -531,7 +531,7 @@
* @param {string} sFolder * @param {string} sFolder
* @param {Array=} aList = [] * @param {Array=} aList = []
*/ */
RainLoopApp.prototype.folderInformation = function (sFolder, aList) AppApp.prototype.folderInformation = function (sFolder, aList)
{ {
if ('' !== Utils.trim(sFolder)) if ('' !== Utils.trim(sFolder))
{ {
@ -635,7 +635,7 @@
/** /**
* @param {boolean=} bBoot = false * @param {boolean=} bBoot = false
*/ */
RainLoopApp.prototype.folderInformationMultiply = function (bBoot) AppApp.prototype.folderInformationMultiply = function (bBoot)
{ {
bBoot = Utils.isUnd(bBoot) ? false : !!bBoot; bBoot = Utils.isUnd(bBoot) ? false : !!bBoot;
@ -721,7 +721,7 @@
} }
}; };
RainLoopApp.prototype.setMessageSeen = function (oMessage) AppApp.prototype.setMessageSeen = function (oMessage)
{ {
if (oMessage.unseen()) if (oMessage.unseen())
{ {
@ -741,17 +741,17 @@
Remote.messageSetSeen(Utils.emptyFunction, oMessage.folderFullNameRaw, [oMessage.uid], true); 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'); 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'); 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'); 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 * @param {boolean=} bFireAllActions
*/ */
RainLoopApp.prototype.socialUsers = function (bFireAllActions) AppApp.prototype.socialUsers = function (bFireAllActions)
{ {
if (bFireAllActions) if (bFireAllActions)
{ {
@ -793,19 +793,19 @@
}); });
}; };
RainLoopApp.prototype.googleDisconnect = function () AppApp.prototype.googleDisconnect = function ()
{ {
Data.googleActions(true); Data.googleActions(true);
Remote.googleDisconnect(this.socialUsers); Remote.googleDisconnect(this.socialUsers);
}; };
RainLoopApp.prototype.facebookDisconnect = function () AppApp.prototype.facebookDisconnect = function ()
{ {
Data.facebookActions(true); Data.facebookActions(true);
Remote.facebookDisconnect(this.socialUsers); Remote.facebookDisconnect(this.socialUsers);
}; };
RainLoopApp.prototype.twitterDisconnect = function () AppApp.prototype.twitterDisconnect = function ()
{ {
Data.twitterActions(true); Data.twitterActions(true);
Remote.twitterDisconnect(this.socialUsers); Remote.twitterDisconnect(this.socialUsers);
@ -815,7 +815,7 @@
* @param {string} sQuery * @param {string} sQuery
* @param {Function} fCallback * @param {Function} fCallback
*/ */
RainLoopApp.prototype.getAutocomplete = function (sQuery, fCallback) AppApp.prototype.getAutocomplete = function (sQuery, fCallback)
{ {
var var
aData = [] aData = []
@ -842,14 +842,14 @@
* @param {string} sQuery * @param {string} sQuery
* @param {Function} fCallback * @param {Function} fCallback
*/ */
RainLoopApp.prototype.getContactTagsAutocomplete = function (sQuery, fCallback) AppApp.prototype.getContactTagsAutocomplete = function (sQuery, fCallback)
{ {
fCallback(_.filter(Data.contactTags(), function (oContactTag) { fCallback(_.filter(Data.contactTags(), function (oContactTag) {
return oContactTag && oContactTag.filterHelper(sQuery); 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'] && if (oData && oData.Result && 'Collection/MessageCollection' === oData.Result['@Object'] &&
oData.Result['@Collection'] && Utils.isArray(oData.Result['@Collection'])) oData.Result['@Collection'] && Utils.isArray(oData.Result['@Collection']))
@ -984,7 +984,7 @@
* @param {Array} aFolders * @param {Array} aFolders
* @return {Array} * @return {Array}
*/ */
RainLoopApp.prototype.folderResponseParseRec = function (sNamespace, aFolders) AppApp.prototype.folderResponseParseRec = function (sNamespace, aFolders)
{ {
var var
self = this, self = this,
@ -1056,7 +1056,7 @@
/** /**
* @param {*} oData * @param {*} oData
*/ */
RainLoopApp.prototype.setFolders = function (oData) AppApp.prototype.setFolders = function (oData)
{ {
var var
aList = [], aList = [],
@ -1121,7 +1121,7 @@
* @param {string} sFullNameHash * @param {string} sFullNameHash
* @return {boolean} * @return {boolean}
*/ */
RainLoopApp.prototype.isFolderExpanded = function (sFullNameHash) AppApp.prototype.isFolderExpanded = function (sFullNameHash)
{ {
var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders); var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders);
return Utils.isArray(aExpandedList) && -1 !== _.indexOf(aExpandedList, sFullNameHash); return Utils.isArray(aExpandedList) && -1 !== _.indexOf(aExpandedList, sFullNameHash);
@ -1131,7 +1131,7 @@
* @param {string} sFullNameHash * @param {string} sFullNameHash
* @param {boolean} bExpanded * @param {boolean} bExpanded
*/ */
RainLoopApp.prototype.setExpandedFolder = function (sFullNameHash, bExpanded) AppApp.prototype.setExpandedFolder = function (sFullNameHash, bExpanded)
{ {
var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders); var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders);
if (!Utils.isArray(aExpandedList)) if (!Utils.isArray(aExpandedList))
@ -1152,7 +1152,7 @@
Local.set(Enums.ClientSideKeyName.ExpandedFolders, aExpandedList); Local.set(Enums.ClientSideKeyName.ExpandedFolders, aExpandedList);
}; };
RainLoopApp.prototype.initLayoutResizer = function (sLeft, sRight, sClientSideKeyName) AppApp.prototype.initLayoutResizer = function (sLeft, sRight, sClientSideKeyName)
{ {
var var
iDisabledWidth = 60, iDisabledWidth = 60,
@ -1223,7 +1223,7 @@
}); });
}; };
RainLoopApp.prototype.bootstartLoginScreen = function () AppApp.prototype.bootstartLoginScreen = function ()
{ {
var sCustomLoginLink = Utils.pString(Settings.settingsGet('CustomLoginLink')); var sCustomLoginLink = Utils.pString(Settings.settingsGet('CustomLoginLink'));
if (!sCustomLoginLink) if (!sCustomLoginLink)
@ -1231,7 +1231,7 @@
kn.hideLoading(); kn.hideLoading();
kn.startScreens([ kn.startScreens([
require('Screen:RainLoop:Login') require('Screen/App/Login')
]); ]);
Plugins.runHook('rl-start-login-screens'); Plugins.runHook('rl-start-login-screens');
@ -1249,7 +1249,7 @@
} }
}; };
RainLoopApp.prototype.bootstart = function () AppApp.prototype.bootstart = function ()
{ {
AbstractApp.prototype.bootstart.call(this); AbstractApp.prototype.bootstart.call(this);
@ -1298,123 +1298,119 @@
{ {
this.setTitle(Utils.i18n('TITLES/LOADING')); 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)
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)
{ {
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 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 else
{ {
@ -1458,6 +1454,6 @@
Events.pub('rl.bootstart-end'); Events.pub('rl.bootstart-end');
}; };
module.exports = new RainLoopApp(); module.exports = new AppApp();
}()); }());

View file

@ -8,7 +8,7 @@
_ = require('_'), _ = require('_'),
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
Settings = require('Storage:Settings') Settings = require('Storage/Settings')
; ;
/** /**
@ -78,6 +78,7 @@
}; };
/** /**
* @param {boolean=} bWrapIsHtml = false
* @return {string} * @return {string}
*/ */
HtmlEditor.prototype.getData = function (bWrapIsHtml) HtmlEditor.prototype.getData = function (bWrapIsHtml)

View file

@ -12,7 +12,7 @@
*/ */
function LinkBuilder() function LinkBuilder()
{ {
var Settings = require('Storage:Settings'); var Settings = require('Storage/Settings');
this.sBase = '#/'; this.sBase = '#/';
this.sServer = './?'; this.sServer = './?';

View file

@ -15,7 +15,7 @@
*/ */
function Plugins() function Plugins()
{ {
this.oSettings = require('Storage:Settings'); this.oSettings = require('Storage/Settings');
this.oViewModelsHooks = {}; this.oViewModelsHooks = {};
this.oSimpleHooks = {}; this.oSimpleHooks = {};
} }

View file

@ -157,7 +157,7 @@
{ {
oParams = Utils.simpleQueryParser(sQueryString); 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.subject) ? null : Utils.pString(oParams.subject),
Utils.isUnd(oParams.body) ? null : Utils.plainToHtml(Utils.pString(oParams.body)) Utils.isUnd(oParams.body) ? null : Utils.plainToHtml(Utils.pString(oParams.body))
]); ]);

21
dev/Knoin/AbstractBoot.js Normal file
View file

@ -0,0 +1,21 @@
(function () {
'use strict';
/**
* @constructor
*/
function AbstractBoot()
{
}
AbstractBoot.prototype.bootstart = function ()
{
};
module.exports = AbstractBoot;
}());

View file

@ -15,7 +15,7 @@
* @param {?=} aViewModels = [] * @param {?=} aViewModels = []
* @constructor * @constructor
*/ */
function KnoinAbstractScreen(sScreenName, aViewModels) function AbstractScreen(sScreenName, aViewModels)
{ {
this.sScreenName = sScreenName; this.sScreenName = sScreenName;
this.aViewModels = Utils.isArray(aViewModels) ? aViewModels : []; this.aViewModels = Utils.isArray(aViewModels) ? aViewModels : [];
@ -24,22 +24,22 @@
/** /**
* @type {Array} * @type {Array}
*/ */
KnoinAbstractScreen.prototype.oCross = null; AbstractScreen.prototype.oCross = null;
/** /**
* @type {string} * @type {string}
*/ */
KnoinAbstractScreen.prototype.sScreenName = ''; AbstractScreen.prototype.sScreenName = '';
/** /**
* @type {Array} * @type {Array}
*/ */
KnoinAbstractScreen.prototype.aViewModels = []; AbstractScreen.prototype.aViewModels = [];
/** /**
* @return {Array} * @return {Array}
*/ */
KnoinAbstractScreen.prototype.viewModels = function () AbstractScreen.prototype.viewModels = function ()
{ {
return this.aViewModels; return this.aViewModels;
}; };
@ -47,12 +47,12 @@
/** /**
* @return {string} * @return {string}
*/ */
KnoinAbstractScreen.prototype.screenName = function () AbstractScreen.prototype.screenName = function ()
{ {
return this.sScreenName; return this.sScreenName;
}; };
KnoinAbstractScreen.prototype.routes = function () AbstractScreen.prototype.routes = function ()
{ {
return null; return null;
}; };
@ -60,12 +60,12 @@
/** /**
* @return {?Object} * @return {?Object}
*/ */
KnoinAbstractScreen.prototype.__cross = function () AbstractScreen.prototype.__cross = function ()
{ {
return this.oCross; return this.oCross;
}; };
KnoinAbstractScreen.prototype.__start = function () AbstractScreen.prototype.__start = function ()
{ {
var var
aRoutes = this.routes(), aRoutes = this.routes(),
@ -86,6 +86,6 @@
} }
}; };
module.exports = KnoinAbstractScreen; module.exports = AbstractScreen;
}()); }());

View file

@ -16,7 +16,7 @@
* @param {string=} sPosition = '' * @param {string=} sPosition = ''
* @param {string=} sTemplate = '' * @param {string=} sTemplate = ''
*/ */
function KnoinAbstractViewModel(sPosition, sTemplate) function AbstractView(sPosition, sTemplate)
{ {
this.bDisabeCloseOnEsc = false; this.bDisabeCloseOnEsc = false;
this.sPosition = Utils.pString(sPosition); this.sPosition = Utils.pString(sPosition);
@ -36,47 +36,47 @@
/** /**
* @type {boolean} * @type {boolean}
*/ */
KnoinAbstractViewModel.prototype.bDisabeCloseOnEsc = false; AbstractView.prototype.bDisabeCloseOnEsc = false;
/** /**
* @type {string} * @type {string}
*/ */
KnoinAbstractViewModel.prototype.sPosition = ''; AbstractView.prototype.sPosition = '';
/** /**
* @type {string} * @type {string}
*/ */
KnoinAbstractViewModel.prototype.sTemplate = ''; AbstractView.prototype.sTemplate = '';
/** /**
* @type {string} * @type {string}
*/ */
KnoinAbstractViewModel.prototype.sDefaultKeyScope = Enums.KeyState.None; AbstractView.prototype.sDefaultKeyScope = Enums.KeyState.None;
/** /**
* @type {string} * @type {string}
*/ */
KnoinAbstractViewModel.prototype.sCurrentKeyScope = Enums.KeyState.None; AbstractView.prototype.sCurrentKeyScope = Enums.KeyState.None;
/** /**
* @type {string} * @type {string}
*/ */
KnoinAbstractViewModel.prototype.viewModelName = ''; AbstractView.prototype.viewModelName = '';
/** /**
* @type {Array} * @type {Array}
*/ */
KnoinAbstractViewModel.prototype.viewModelNames = []; AbstractView.prototype.viewModelNames = [];
/** /**
* @type {?} * @type {?}
*/ */
KnoinAbstractViewModel.prototype.viewModelDom = null; AbstractView.prototype.viewModelDom = null;
/** /**
* @return {string} * @return {string}
*/ */
KnoinAbstractViewModel.prototype.viewModelTemplate = function () AbstractView.prototype.viewModelTemplate = function ()
{ {
return this.sTemplate; return this.sTemplate;
}; };
@ -84,26 +84,26 @@
/** /**
* @return {string} * @return {string}
*/ */
KnoinAbstractViewModel.prototype.viewModelPosition = function () AbstractView.prototype.viewModelPosition = function ()
{ {
return this.sPosition; return this.sPosition;
}; };
KnoinAbstractViewModel.prototype.cancelCommand = function () {}; AbstractView.prototype.cancelCommand = function () {};
KnoinAbstractViewModel.prototype.closeCommand = function () {}; AbstractView.prototype.closeCommand = function () {};
KnoinAbstractViewModel.prototype.storeAndSetKeyScope = function () AbstractView.prototype.storeAndSetKeyScope = function ()
{ {
this.sCurrentKeyScope = Globals.keyScope(); this.sCurrentKeyScope = Globals.keyScope();
Globals.keyScope(this.sDefaultKeyScope); Globals.keyScope(this.sDefaultKeyScope);
}; };
KnoinAbstractViewModel.prototype.restoreKeyScope = function () AbstractView.prototype.restoreKeyScope = function ()
{ {
Globals.keyScope(this.sCurrentKeyScope); Globals.keyScope(this.sCurrentKeyScope);
}; };
KnoinAbstractViewModel.prototype.registerPopupKeyDown = function () AbstractView.prototype.registerPopupKeyDown = function ()
{ {
var self = this; var self = this;
@ -125,6 +125,6 @@
}); });
}; };
module.exports = KnoinAbstractViewModel; module.exports = AbstractView;
}()); }());

View file

@ -1,21 +0,0 @@
(function () {
'use strict';
/**
* @constructor
*/
function KnoinAbstractBoot()
{
}
KnoinAbstractBoot.prototype.bootstart = function ()
{
};
module.exports = KnoinAbstractBoot;
}());

View file

@ -353,7 +353,7 @@
MessageModel.prototype.computeSenderEmail = function () MessageModel.prototype.computeSenderEmail = function ()
{ {
var var
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
sSent = Data.sentFolder(), sSent = Data.sentFolder(),
sDraft = Data.draftFolder() sDraft = Data.draftFolder()
; ;
@ -432,7 +432,7 @@
{ {
var var
bResult = false, bResult = false,
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
iPriority = Enums.MessagePriority.Normal iPriority = Enums.MessagePriority.Normal
; ;
@ -1088,7 +1088,7 @@
this.body.data('rl-plain-raw', this.plainRaw); this.body.data('rl-plain-raw', this.plainRaw);
var Data = require('Storage:RainLoop:Data'); var Data = require('Storage/App/Data');
if (Data.capaOpenPGP()) if (Data.capaOpenPGP())
{ {
this.body.data('rl-plain-pgp-signed', !!this.isPgpSigned()); this.body.data('rl-plain-pgp-signed', !!this.isPgpSigned());
@ -1101,7 +1101,7 @@
MessageModel.prototype.storePgpVerifyDataToDom = function () MessageModel.prototype.storePgpVerifyDataToDom = function ()
{ {
var Data = require('Storage:RainLoop:Data'); var Data = require('Storage/App/Data');
if (this.body && Data.capaOpenPGP()) if (this.body && Data.capaOpenPGP())
{ {
this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus()); this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus());
@ -1118,7 +1118,7 @@
this.plainRaw = Utils.pString(this.body.data('rl-plain-raw')); 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()) if (Data.capaOpenPGP())
{ {
this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed')); this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed'));
@ -1143,7 +1143,7 @@
var var
aRes = [], aRes = [],
mPgpMessage = null, 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 : '', sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
aPublicKeys = Data.findPublicKeysByEmail(sFrom), aPublicKeys = Data.findPublicKeysByEmail(sFrom),
oValidKey = null, oValidKey = null,
@ -1207,7 +1207,7 @@
aRes = [], aRes = [],
mPgpMessage = null, mPgpMessage = null,
mPgpMessageDecrypted = 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 : '', sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
aPublicKey = Data.findPublicKeysByEmail(sFrom), aPublicKey = Data.findPublicKeysByEmail(sFrom),
oPrivateKey = Data.findSelfPrivateKey(sPassword), oPrivateKey = Data.findSelfPrivateKey(sPassword),

View file

@ -1,4 +0,0 @@
(function (require) {
'use strict';
require('App:Boot')(require('App:RainLoop'));
}(require));

View file

@ -12,18 +12,18 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractScreen = require('Knoin:AbstractScreen') AbstractScreen = require('Knoin/AbstractScreen')
; ;
/** /**
* @constructor * @constructor
* @param {Array} aViewModels * @param {Array} aViewModels
* @extends KnoinAbstractScreen * @extends AbstractScreen
*/ */
function AbstractSettingsScreen(aViewModels) function AbstractSettingsScreen(aViewModels)
{ {
KnoinAbstractScreen.call(this, 'settings', aViewModels); AbstractScreen.call(this, 'settings', aViewModels);
this.menu = ko.observableArray([]); this.menu = ko.observableArray([]);
@ -33,7 +33,7 @@
this.setupSettings(); this.setupSettings();
} }
_.extend(AbstractSettingsScreen.prototype, KnoinAbstractScreen.prototype); _.extend(AbstractSettingsScreen.prototype, AbstractScreen.prototype);
/** /**
* @param {Function=} fCallback * @param {Function=} fCallback

32
dev/Screen/Admin/Login.js Normal file
View file

@ -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;
}());

View file

@ -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;
}());

32
dev/Screen/App/About.js Normal file
View file

@ -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;
}());

32
dev/Screen/App/Login.js Normal file
View file

@ -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;
}());

View file

@ -11,49 +11,49 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Events = require('Common/Events'), 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'), AbstractScreen = require('Knoin/AbstractScreen')
Data = require('Storage:RainLoop:Data'),
Cache = require('Storage:RainLoop:Cache'),
Remote = require('Storage:RainLoop:Remote')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractScreen * @extends AbstractScreen
*/ */
function MailBoxScreen() function MailBoxAppScreen()
{ {
KnoinAbstractScreen.call(this, 'mailbox', [ AbstractScreen.call(this, 'mailbox', [
require('View:RainLoop:MailBoxSystemDropDown'), require('View/App/MailBox/SystemDropDown'),
require('View:RainLoop:MailBoxFolderList'), require('View/App/MailBox/FolderList'),
require('View:RainLoop:MailBoxMessageList'), require('View/App/MailBox/MessageList'),
require('View:RainLoop:MailBoxMessageView') require('View/App/MailBox/MessageView')
]); ]);
this.oLastRoute = {}; this.oLastRoute = {};
} }
_.extend(MailBoxScreen.prototype, KnoinAbstractScreen.prototype); _.extend(MailBoxAppScreen.prototype, AbstractScreen.prototype);
/** /**
* @type {Object} * @type {Object}
*/ */
MailBoxScreen.prototype.oLastRoute = {}; MailBoxAppScreen.prototype.oLastRoute = {};
MailBoxScreen.prototype.setNewTitle = function () MailBoxAppScreen.prototype.setNewTitle = function ()
{ {
var var
sEmail = Data.accountEmail(), sEmail = Data.accountEmail(),
nFoldersInboxUnreadCount = Data.foldersInboxUnreadCount() nFoldersInboxUnreadCount = Data.foldersInboxUnreadCount()
; ;
require('App:RainLoop').setTitle(('' === sEmail ? '' : require('App/App').setTitle(('' === sEmail ? '' :
(0 < nFoldersInboxUnreadCount ? '(' + nFoldersInboxUnreadCount + ') ' : ' ') + sEmail + ' - ') + Utils.i18n('TITLES/MAILBOX')); (0 < nFoldersInboxUnreadCount ? '(' + nFoldersInboxUnreadCount + ') ' : ' ') + sEmail + ' - ') + Utils.i18n('TITLES/MAILBOX'));
}; };
MailBoxScreen.prototype.onShow = function () MailBoxAppScreen.prototype.onShow = function ()
{ {
this.setNewTitle(); this.setNewTitle();
Globals.keyScope(Enums.KeyState.MessageList); Globals.keyScope(Enums.KeyState.MessageList);
@ -65,13 +65,13 @@
* @param {string} sSearch * @param {string} sSearch
* @param {boolean=} bPreview = false * @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 (Utils.isUnd(bPreview) ? false : !!bPreview)
{ {
if (Enums.Layout.NoPreview === Data.layout() && !Data.message()) if (Enums.Layout.NoPreview === Data.layout() && !Data.message())
{ {
require('App:RainLoop').historyBack(); require('App/App').historyBack();
} }
} }
else else
@ -94,12 +94,12 @@
Data.message(null); Data.message(null);
} }
require('App:RainLoop').reloadMessageList(); require('App/App').reloadMessageList();
} }
} }
}; };
MailBoxScreen.prototype.onStart = function () MailBoxAppScreen.prototype.onStart = function ()
{ {
var var
fResizeFunction = function () { fResizeFunction = function () {
@ -109,18 +109,18 @@
if (Settings.capa(Enums.Capa.AdditionalAccounts) || Settings.capa(Enums.Capa.AdditionalIdentities)) if (Settings.capa(Enums.Capa.AdditionalAccounts) || Settings.capa(Enums.Capa.AdditionalIdentities))
{ {
require('App:RainLoop').accountsAndIdentities(); require('App/App').accountsAndIdentities();
} }
_.delay(function () { _.delay(function () {
if ('INBOX' !== Data.currentFolderFullNameRaw()) if ('INBOX' !== Data.currentFolderFullNameRaw())
{ {
require('App:RainLoop').folderInformation('INBOX'); require('App/App').folderInformation('INBOX');
} }
}, 1000); }, 1000);
_.delay(function () { _.delay(function () {
require('App:RainLoop').quota(); require('App/App').quota();
}, 5000); }, 5000);
_.delay(function () { _.delay(function () {
@ -149,7 +149,7 @@
/** /**
* @return {Array} * @return {Array}
*/ */
MailBoxScreen.prototype.routes = function () MailBoxAppScreen.prototype.routes = function ()
{ {
var var
fNormP = function () { fNormP = function () {
@ -191,6 +191,6 @@
]; ];
}; };
module.exports = MailBoxScreen; module.exports = MailBoxAppScreen;
}()); }());

View file

@ -10,23 +10,23 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Globals = require('Common/Globals'), 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 * @constructor
* @extends AbstractSettingsScreen * @extends AbstractSettingsScreen
*/ */
function SettingsScreen() function SettingsAppScreen()
{ {
AbstractSettingsScreen.call(this, [ AbstractSettingsScreen.call(this, [
require('View:RainLoop:SettingsSystemDropDown'), require('View/App/Settings/SystemDropDown'),
require('View:RainLoop:SettingsMenu'), require('View/App/Settings/Menu'),
require('View:RainLoop:SettingsPane') require('View/App/Settings/Pane')
]); ]);
Utils.initOnStartOrLangChange(function () { Utils.initOnStartOrLangChange(function () {
@ -36,48 +36,48 @@
}); });
} }
_.extend(SettingsScreen.prototype, AbstractSettingsScreen.prototype); _.extend(SettingsAppScreen.prototype, AbstractSettingsScreen.prototype);
/** /**
* @param {Function=} fCallback * @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); 'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
if (Settings.settingsGet('ContactsIsAllowed')) if (Settings.settingsGet('ContactsIsAllowed'))
{ {
kn.addSettingsViewModel(require('Settings:RainLoop:Contacts'), kn.addSettingsViewModel(require('Settings/App/Contacts'),
'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts'); 'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
} }
if (Settings.capa(Enums.Capa.AdditionalAccounts)) 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'); 'SettingsAccounts', 'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME', 'accounts');
} }
if (Settings.capa(Enums.Capa.AdditionalIdentities)) 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'); 'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities');
} }
else else
{ {
kn.addSettingsViewModel(require('Settings:RainLoop:Identity'), kn.addSettingsViewModel(require('Settings/App/Identity'),
'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity'); 'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity');
} }
if (Settings.capa(Enums.Capa.Filters)) 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'); 'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
} }
if (Settings.capa(Enums.Capa.TwoFactor)) 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'); 'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
} }
@ -85,28 +85,28 @@
Settings.settingsGet('AllowFacebookSocial') || Settings.settingsGet('AllowFacebookSocial') ||
Settings.settingsGet('AllowTwitterSocial')) Settings.settingsGet('AllowTwitterSocial'))
{ {
kn.addSettingsViewModel(require('Settings:RainLoop:Social'), kn.addSettingsViewModel(require('Settings/App/Social'),
'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social'); 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
} }
if (Settings.settingsGet('ChangePasswordIsAllowed')) 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'); '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'); 'SettingsFolders', 'SETTINGS_LABELS/LABEL_FOLDERS_NAME', 'folders');
if (Settings.capa(Enums.Capa.Themes)) 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'); 'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes');
} }
if (Settings.capa(Enums.Capa.OpenPGP)) 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'); 'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp');
} }
@ -116,17 +116,17 @@
} }
}; };
SettingsScreen.prototype.onShow = function () SettingsAppScreen.prototype.onShow = function ()
{ {
this.setSettingsTitle(); this.setSettingsTitle();
Globals.keyScope(Enums.KeyState.Settings); 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;
}()); }());

View file

@ -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;
}());

View file

@ -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;
}());

View file

@ -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;
}());

View file

@ -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;
}());

View file

@ -10,11 +10,11 @@
/** /**
* @constructor * @constructor
*/ */
function AdminSettingsAbout() function AboutAdminSetting()
{ {
var var
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:Admin:Data') Data = require('Storage/Admin/Data')
; ;
this.version = ko.observable(Settings.settingsGet('Version')); this.version = ko.observable(Settings.settingsGet('Version'));
@ -67,22 +67,22 @@
}, this); }, this);
} }
AdminSettingsAbout.prototype.onBuild = function () AboutAdminSetting.prototype.onBuild = function ()
{ {
if (this.access()) if (this.access())
{ {
require('App:Admin').reloadCoreData(); require('App/Admin').reloadCoreData();
} }
}; };
AdminSettingsAbout.prototype.updateCoreData = function () AboutAdminSetting.prototype.updateCoreData = function ()
{ {
if (!this.coreUpdating()) if (!this.coreUpdating())
{ {
require('App:Admin').updateCoreData(); require('App/Admin').updateCoreData();
} }
}; };
module.exports = AdminSettingsAbout; module.exports = AboutAdminSetting;
}()); }());

View file

@ -13,11 +13,11 @@
/** /**
* @constructor * @constructor
*/ */
function AdminSettingsBranding() function BrandingAdminSetting()
{ {
var var
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Settings = require('Storage:Settings') Settings = require('Storage/Settings')
; ;
this.title = ko.observable(Settings.settingsGet('Title')); this.title = ko.observable(Settings.settingsGet('Title'));
@ -36,11 +36,11 @@
this.loginCss.trigger = ko.observable(Enums.SaveSettingsStep.Idle); this.loginCss.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
} }
AdminSettingsBranding.prototype.onBuild = function () BrandingAdminSetting.prototype.onBuild = function ()
{ {
var var
self = this, self = this,
Remote = require('Storage:Admin:Remote') Remote = require('Storage/Admin/Remote')
; ;
_.delay(function () { _.delay(function () {
@ -86,6 +86,6 @@
}, 50); }, 50);
}; };
module.exports = AdminSettingsBranding; module.exports = BrandingAdminSetting;
}()); }());

View file

@ -10,16 +10,16 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Settings = require('Storage:Settings') Settings = require('Storage/Settings')
; ;
/** /**
* @constructor * @constructor
*/ */
function AdminSettingsContacts() function ContactsAdminSetting()
{ {
var var
Remote = require('Storage:Admin:Remote') Remote = require('Storage/Admin/Remote')
; ;
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender; this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
@ -141,7 +141,7 @@
this.onTestContactsResponse = _.bind(this.onTestContactsResponse, this); this.onTestContactsResponse = _.bind(this.onTestContactsResponse, this);
} }
AdminSettingsContacts.prototype.onTestContactsResponse = function (sResult, oData) ContactsAdminSetting.prototype.onTestContactsResponse = function (sResult, oData)
{ {
this.testContactsSuccess(false); this.testContactsSuccess(false);
this.testContactsError(false); this.testContactsError(false);
@ -167,18 +167,18 @@
this.testing(false); this.testing(false);
}; };
AdminSettingsContacts.prototype.onShow = function () ContactsAdminSetting.prototype.onShow = function ()
{ {
this.testContactsSuccess(false); this.testContactsSuccess(false);
this.testContactsError(false); this.testContactsError(false);
this.testContactsErrorMessage(''); this.testContactsErrorMessage('');
}; };
AdminSettingsContacts.prototype.onBuild = function () ContactsAdminSetting.prototype.onBuild = function ()
{ {
var var
self = this, self = this,
Remote = require('Storage:Admin:Remote') Remote = require('Storage/Admin/Remote')
; ;
_.delay(function () { _.delay(function () {
@ -237,6 +237,6 @@
}, 50); }, 50);
}; };
module.exports = AdminSettingsContacts; module.exports = ContactsAdminSetting;
}()); }());

View file

@ -10,16 +10,16 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
PopupsDomainViewModel = require('View:Popup:Domain'), PopupsDomainViewModel = require('View/Popup/Domain'),
Data = require('Storage:Admin:Data'), Data = require('Storage/Admin/Data'),
Remote = require('Storage:Admin:Remote') Remote = require('Storage/Admin/Remote')
; ;
/** /**
* @constructor * @constructor
*/ */
function AdminSettingsDomains() function DomainsAdminSetting()
{ {
this.domains = Data.domains; this.domains = Data.domains;
this.domainsLoading = Data.domainsLoading; this.domainsLoading = Data.domainsLoading;
@ -46,7 +46,7 @@
]}); ]});
} }
AdminSettingsDomains.prototype.startDomainForDeletionTimeout = function () DomainsAdminSetting.prototype.startDomainForDeletionTimeout = function ()
{ {
var self = this; var self = this;
window.clearInterval(this.iDomainForDeletionTimeout); window.clearInterval(this.iDomainForDeletionTimeout);
@ -55,24 +55,24 @@
}, 1000 * 3); }, 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); this.domains.remove(oDomain);
Remote.domainDelete(_.bind(this.onDomainListChangeRequest, this), oDomain.name); Remote.domainDelete(_.bind(this.onDomainListChangeRequest, this), oDomain.name);
}; };
AdminSettingsDomains.prototype.disableDomain = function (oDomain) DomainsAdminSetting.prototype.disableDomain = function (oDomain)
{ {
oDomain.disabled(!oDomain.disabled()); oDomain.disabled(!oDomain.disabled());
Remote.domainDisable(_.bind(this.onDomainListChangeRequest, this), oDomain.name, 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; var self = this;
oDom 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) 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;
}()); }());

View file

@ -11,14 +11,14 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:Admin:Data') Data = require('Storage/Admin/Data')
; ;
/** /**
* @constructor * @constructor
*/ */
function AdminSettingsGeneral() function GeneralAdminSetting()
{ {
this.mainLanguage = Data.mainLanguage; this.mainLanguage = Data.mainLanguage;
this.mainTheme = Data.mainTheme; this.mainTheme = Data.mainTheme;
@ -61,11 +61,11 @@
this.themeTrigger = ko.observable(Enums.SaveSettingsStep.Idle); this.themeTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
} }
AdminSettingsGeneral.prototype.onBuild = function () GeneralAdminSetting.prototype.onBuild = function ()
{ {
var var
self = this, self = this,
Remote = require('Storage:Admin:Remote') Remote = require('Storage/Admin/Remote')
; ;
_.delay(function () { _.delay(function () {
@ -127,19 +127,19 @@
}, 50); }, 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} * @return {string}
*/ */
AdminSettingsGeneral.prototype.phpInfoLink = function () GeneralAdminSetting.prototype.phpInfoLink = function ()
{ {
return LinkBuilder.phpInfo(); return LinkBuilder.phpInfo();
}; };
module.exports = AdminSettingsGeneral; module.exports = GeneralAdminSetting;
}()); }());

View file

@ -7,14 +7,14 @@
ko = require('ko'), ko = require('ko'),
moment = require('moment'), moment = require('moment'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:Admin:Data') Data = require('Storage/Admin/Data')
; ;
/** /**
* @constructor * @constructor
*/ */
function AdminSettingsLicensing() function LicensingAdminSetting()
{ {
this.licensing = Data.licensing; this.licensing = Data.licensing;
this.licensingProcess = Data.licensingProcess; this.licensingProcess = Data.licensingProcess;
@ -29,33 +29,33 @@
this.licenseTrigger.subscribe(function () { this.licenseTrigger.subscribe(function () {
if (this.subscriptionEnabled()) if (this.subscriptionEnabled())
{ {
require('App:Admin').reloadLicensing(true); require('App/Admin').reloadLicensing(true);
} }
}, this); }, this);
} }
AdminSettingsLicensing.prototype.onBuild = function () LicensingAdminSetting.prototype.onBuild = function ()
{ {
if (this.subscriptionEnabled()) 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')); 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} * @returns {string}
*/ */
AdminSettingsLicensing.prototype.licenseExpiredMomentValue = function () LicensingAdminSetting.prototype.licenseExpiredMomentValue = function ()
{ {
var var
iTime = this.licenseExpired(), iTime = this.licenseExpired(),
@ -65,6 +65,6 @@
return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')'); return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')');
}; };
module.exports = AdminSettingsLicensing; module.exports = LicensingAdminSetting;
}()); }());

View file

@ -10,14 +10,14 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:Admin:Data') Data = require('Storage/Admin/Data')
; ;
/** /**
* @constructor * @constructor
*/ */
function AdminSettingsLogin() function LoginAdminSetting()
{ {
this.determineUserLanguage = Data.determineUserLanguage; this.determineUserLanguage = Data.determineUserLanguage;
this.determineUserDomain = Data.determineUserDomain; this.determineUserDomain = Data.determineUserDomain;
@ -28,11 +28,11 @@
this.defaultDomainTrigger = ko.observable(Enums.SaveSettingsStep.Idle); this.defaultDomainTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
} }
AdminSettingsLogin.prototype.onBuild = function () LoginAdminSetting.prototype.onBuild = function ()
{ {
var var
self = this, self = this,
Remote = require('Storage:Admin:Remote') Remote = require('Storage/Admin/Remote')
; ;
_.delay(function () { _.delay(function () {
@ -66,6 +66,6 @@
}, 50); }, 50);
}; };
module.exports = AdminSettingsLogin; module.exports = LoginAdminSetting;
}()); }());

View file

@ -10,14 +10,14 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Data = require('Storage:Admin:Data'), Data = require('Storage/Admin/Data'),
Remote = require('Storage:Admin:Remote') Remote = require('Storage/Admin/Remote')
; ;
/** /**
* @constructor * @constructor
*/ */
function AdminSettingsPackages() function PackagesAdminSetting()
{ {
this.packagesError = ko.observable(''); this.packagesError = ko.observable('');
@ -43,17 +43,17 @@
}, this); }, this);
} }
AdminSettingsPackages.prototype.onShow = function () PackagesAdminSetting.prototype.onShow = function ()
{ {
this.packagesError(''); 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; var self = this;
return function (sResult, oData) { return function (sResult, oData) {
@ -85,12 +85,12 @@
} }
else else
{ {
require('App:Admin').reloadPackagesList(); require('App/Admin').reloadPackagesList();
} }
}; };
}; };
AdminSettingsPackages.prototype.deletePackage = function (oPackage) PackagesAdminSetting.prototype.deletePackage = function (oPackage)
{ {
if (oPackage) if (oPackage)
{ {
@ -99,7 +99,7 @@
} }
}; };
AdminSettingsPackages.prototype.installPackage = function (oPackage) PackagesAdminSetting.prototype.installPackage = function (oPackage)
{ {
if (oPackage) if (oPackage)
{ {
@ -108,6 +108,6 @@
} }
}; };
module.exports = AdminSettingsPackages; module.exports = PackagesAdminSetting;
}()); }());

View file

@ -10,15 +10,15 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:Admin:Data'), Data = require('Storage/Admin/Data'),
Remote = require('Storage:Admin:Remote') Remote = require('Storage/Admin/Remote')
; ;
/** /**
* @constructor * @constructor
*/ */
function AdminSettingsPlugins() function PluginsAdminSetting()
{ {
this.enabledPlugins = ko.observable(!!Settings.settingsGet('EnabledPlugins')); this.enabledPlugins = ko.observable(!!Settings.settingsGet('EnabledPlugins'));
@ -35,18 +35,18 @@
this.onPluginDisableRequest = _.bind(this.onPluginDisableRequest, this); this.onPluginDisableRequest = _.bind(this.onPluginDisableRequest, this);
} }
AdminSettingsPlugins.prototype.disablePlugin = function (oPlugin) PluginsAdminSetting.prototype.disablePlugin = function (oPlugin)
{ {
oPlugin.disabled(!oPlugin.disabled()); oPlugin.disabled(!oPlugin.disabled());
Remote.pluginDisable(this.onPluginDisableRequest, oPlugin.name, 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); Remote.plugin(this.onPluginLoadRequest, oPlugin.name);
}; };
AdminSettingsPlugins.prototype.onBuild = function (oDom) PluginsAdminSetting.prototype.onBuild = function (oDom)
{ {
var self = this; var self = this;
@ -74,21 +74,21 @@
}); });
}; };
AdminSettingsPlugins.prototype.onShow = function () PluginsAdminSetting.prototype.onShow = function ()
{ {
this.pluginsError(''); 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) 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) if (Enums.StorageResultType.Success === sResult && oData)
{ {
@ -105,9 +105,9 @@
} }
} }
require('App:Admin').reloadPluginList(); require('App/Admin').reloadPluginList();
}; };
module.exports = AdminSettingsPlugins; module.exports = PluginsAdminSetting;
}()); }());

View file

@ -11,15 +11,15 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:Admin:Data'), Data = require('Storage/Admin/Data'),
Remote = require('Storage:Admin:Remote') Remote = require('Storage/Admin/Remote')
; ;
/** /**
* @constructor * @constructor
*/ */
function AdminSettingsSecurity() function SecurityAdminSetting()
{ {
this.useLocalProxyForExternalImages = Data.useLocalProxyForExternalImages; this.useLocalProxyForExternalImages = Data.useLocalProxyForExternalImages;
@ -75,7 +75,7 @@
this.onNewAdminPasswordResponse = _.bind(this.onNewAdminPasswordResponse, this); 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) if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{ {
@ -91,10 +91,10 @@
} }
}; };
AdminSettingsSecurity.prototype.onBuild = function () SecurityAdminSetting.prototype.onBuild = function ()
{ {
var var
Remote = require('Storage:Admin:Remote') Remote = require('Storage/Admin/Remote')
; ;
this.capaOpenPGP.subscribe(function (bValue) { this.capaOpenPGP.subscribe(function (bValue) {
@ -116,7 +116,7 @@
}); });
}; };
AdminSettingsSecurity.prototype.onHide = function () SecurityAdminSetting.prototype.onHide = function ()
{ {
this.adminPassword(''); this.adminPassword('');
this.adminPasswordNew(''); this.adminPasswordNew('');
@ -126,11 +126,11 @@
/** /**
* @return {string} * @return {string}
*/ */
AdminSettingsSecurity.prototype.phpInfoLink = function () SecurityAdminSetting.prototype.phpInfoLink = function ()
{ {
return LinkBuilder.phpInfo(); return LinkBuilder.phpInfo();
}; };
module.exports = AdminSettingsSecurity; module.exports = SecurityAdminSetting;
}()); }());

View file

@ -14,14 +14,15 @@
/** /**
* @constructor * @constructor
*/ */
function AdminSettingsSocial() function SocialAdminSetting()
{ {
var Data = require('Storage:Admin:Data'); var Data = require('Storage/Admin/Data');
this.googleEnable = Data.googleEnable; this.googleEnable = Data.googleEnable;
this.googleClientID = Data.googleClientID; this.googleClientID = Data.googleClientID;
this.googleApiKey = Data.googleApiKey; this.googleApiKey = Data.googleApiKey;
this.googleClientSecret = Data.googleClientSecret; this.googleClientSecret = Data.googleClientSecret;
this.googleTrigger1 = ko.observable(Enums.SaveSettingsStep.Idle); this.googleTrigger1 = ko.observable(Enums.SaveSettingsStep.Idle);
this.googleTrigger2 = ko.observable(Enums.SaveSettingsStep.Idle); this.googleTrigger2 = ko.observable(Enums.SaveSettingsStep.Idle);
this.googleTrigger3 = ko.observable(Enums.SaveSettingsStep.Idle); this.googleTrigger3 = ko.observable(Enums.SaveSettingsStep.Idle);
@ -44,11 +45,11 @@
this.dropboxTrigger1 = ko.observable(Enums.SaveSettingsStep.Idle); this.dropboxTrigger1 = ko.observable(Enums.SaveSettingsStep.Idle);
} }
AdminSettingsSocial.prototype.onBuild = function () SocialAdminSetting.prototype.onBuild = function ()
{ {
var var
self = this, self = this,
Remote = require('Storage:Admin:Remote') Remote = require('Storage/Admin/Remote')
; ;
_.delay(function () { _.delay(function () {
@ -148,6 +149,6 @@
}, 50); }, 50);
}; };
module.exports = AdminSettingsSocial; module.exports = SocialAdminSetting;
}()); }());

View file

@ -12,14 +12,14 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote') Remote = require('Storage/App/Remote')
; ;
/** /**
* @constructor * @constructor
*/ */
function SettingsAccounts() function AccountsAppSetting()
{ {
this.accounts = Data.accounts; 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 * @param {AccountModel} oAccountToRemove
*/ */
SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove) AccountsAppSetting.prototype.deleteAccount = function (oAccountToRemove)
{ {
if (oAccountToRemove && oAccountToRemove.deleteAccess()) if (oAccountToRemove && oAccountToRemove.deleteAccess())
{ {
this.accountForDeletion(null); this.accountForDeletion(null);
var var
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
fRemoveAccount = function (oAccount) { fRemoveAccount = function (oAccount) {
return oAccountToRemove === oAccount; return oAccountToRemove === oAccount;
} }
@ -86,7 +86,7 @@
} }
else else
{ {
require('App:RainLoop').accountsAndIdentities(); require('App/App').accountsAndIdentities();
} }
}, oAccountToRemove.email); }, oAccountToRemove.email);
@ -94,6 +94,6 @@
} }
}; };
module.exports = SettingsAccounts; module.exports = AccountsAppSetting;
}()); }());

View file

@ -10,13 +10,13 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Remote = require('Storage:RainLoop:Remote') Remote = require('Storage/App/Remote')
; ;
/** /**
* @constructor * @constructor
*/ */
function SettingsChangePassword() function ChangePasswordAppSetting()
{ {
this.changeProcess = ko.observable(false); this.changeProcess = ko.observable(false);
@ -76,7 +76,7 @@
this.onChangePasswordResponse = _.bind(this.onChangePasswordResponse, this); this.onChangePasswordResponse = _.bind(this.onChangePasswordResponse, this);
} }
SettingsChangePassword.prototype.onHide = function () ChangePasswordAppSetting.prototype.onHide = function ()
{ {
this.changeProcess(false); this.changeProcess(false);
this.currentPassword(''); this.currentPassword('');
@ -87,7 +87,7 @@
this.currentPassword.error(false); this.currentPassword.error(false);
}; };
SettingsChangePassword.prototype.onChangePasswordResponse = function (sResult, oData) ChangePasswordAppSetting.prototype.onChangePasswordResponse = function (sResult, oData)
{ {
this.changeProcess(false); this.changeProcess(false);
this.passwordMismatch(false); this.passwordMismatch(false);
@ -116,6 +116,6 @@
} }
}; };
module.exports = SettingsChangePassword; module.exports = ChangePasswordAppSetting;
}()); }());

View file

@ -6,16 +6,14 @@
var var
ko = require('ko'), ko = require('ko'),
Utils = require('Common/Utils'), Remote = require('Storage/App/Remote'),
Data = require('Storage/App/Data')
Remote = require('Storage:RainLoop:Remote'),
Data = require('Storage:RainLoop:Data')
; ;
/** /**
* @constructor * @constructor
*/ */
function SettingsContacts() function ContactsAppSetting()
{ {
this.contactsAutosave = Data.contactsAutosave; this.contactsAutosave = Data.contactsAutosave;
@ -44,7 +42,7 @@
}, this); }, this);
} }
SettingsContacts.prototype.onBuild = function () ContactsAppSetting.prototype.onBuild = function ()
{ {
Data.contactsAutosave.subscribe(function (bValue) { Data.contactsAutosave.subscribe(function (bValue) {
Remote.saveSettings(null, { Remote.saveSettings(null, {
@ -53,6 +51,6 @@
}); });
}; };
module.exports = SettingsContacts; module.exports = ContactsAppSetting;
}()); }());

View file

@ -12,7 +12,7 @@
/** /**
* @constructor * @constructor
*/ */
function SettingsFilters() function FiltersAppSetting()
{ {
this.filters = ko.observableArray([]); this.filters = ko.observableArray([]);
this.filters.loading = ko.observable(false); this.filters.loading = ko.observable(false);
@ -22,21 +22,21 @@
}); });
} }
SettingsFilters.prototype.deleteFilter = function (oFilter) FiltersAppSetting.prototype.deleteFilter = function (oFilter)
{ {
this.filters.remove(oFilter); this.filters.remove(oFilter);
}; };
SettingsFilters.prototype.addFilter = function () FiltersAppSetting.prototype.addFilter = function ()
{ {
var var
FilterModel = require('Model/Filter') FilterModel = require('Model/Filter')
; ;
require('App:Knoin').showScreenPopup( require('Knoin/Knoin').showScreenPopup(
require('View:Popup:Filter'), [new FilterModel()]); require('View/Popup/Filter'), [new FilterModel()]);
}; };
module.exports = SettingsFilters; module.exports = FiltersAppSetting;
}()); }());

View file

@ -9,17 +9,17 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Cache = require('Storage:RainLoop:Cache'), Cache = require('Storage/App/Cache'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
LocalStorage = require('Storage:LocalStorage') Local = require('Storage/Local')
; ;
/** /**
* @constructor * @constructor
*/ */
function SettingsFolders() function FoldersAppSetting()
{ {
this.foldersListError = Data.foldersListError; this.foldersListError = Data.foldersListError;
this.folderList = Data.folderList; this.folderList = Data.folderList;
@ -89,7 +89,7 @@
this.useImapSubscribe = !!Settings.settingsGet('UseImapSubscribe'); this.useImapSubscribe = !!Settings.settingsGet('UseImapSubscribe');
} }
SettingsFolders.prototype.folderEditOnEnter = function (oFolder) FoldersAppSetting.prototype.folderEditOnEnter = function (oFolder)
{ {
var var
sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : '' sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : ''
@ -97,7 +97,7 @@
if ('' !== sEditName && oFolder.name() !== sEditName) if ('' !== sEditName && oFolder.name() !== sEditName)
{ {
LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, ''); Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
Data.foldersRenaming(true); Data.foldersRenaming(true);
Remote.folderRename(function (sResult, oData) { Remote.folderRename(function (sResult, oData) {
@ -109,7 +109,7 @@
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_RENAME_FOLDER')); oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_RENAME_FOLDER'));
} }
require('App:RainLoop').folders(); require('App/App').folders();
}, oFolder.fullNameRaw, sEditName); }, oFolder.fullNameRaw, sEditName);
@ -121,7 +121,7 @@
oFolder.edited(false); oFolder.edited(false);
}; };
SettingsFolders.prototype.folderEditOnEsc = function (oFolder) FoldersAppSetting.prototype.folderEditOnEsc = function (oFolder)
{ {
if (oFolder) if (oFolder)
{ {
@ -129,22 +129,22 @@
} }
}; };
SettingsFolders.prototype.onShow = function () FoldersAppSetting.prototype.onShow = function ()
{ {
Data.foldersListError(''); 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() && if (oFolderToRemove && oFolderToRemove.canBeDeleted() && oFolderToRemove.deleteAccess() &&
0 === oFolderToRemove.privateMessageCountAll()) 0 === oFolderToRemove.privateMessageCountAll())
@ -166,7 +166,7 @@
if (oFolderToRemove) if (oFolderToRemove)
{ {
LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, ''); Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
Data.folderList.remove(fRemoveFolder); Data.folderList.remove(fRemoveFolder);
@ -180,7 +180,7 @@
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_DELETE_FOLDER')); oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_DELETE_FOLDER'));
} }
require('App:RainLoop').folders(); require('App/App').folders();
}, oFolderToRemove.fullNameRaw); }, 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); Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, true);
oFolder.subScribed(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); Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, false);
oFolder.subScribed(false); oFolder.subScribed(false);
}; };
module.exports = SettingsFolders; module.exports = FoldersAppSetting;
}()); }());

View file

@ -5,23 +5,21 @@
var var
_ = require('_'), _ = require('_'),
$ = require('$'),
ko = require('ko'), ko = require('ko'),
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Consts = require('Common/Consts'), Consts = require('Common/Consts'),
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote') Remote = require('Storage/App/Remote')
; ;
/** /**
* @constructor * @constructor
*/ */
function SettingsGeneral() function GeneralAppSetting()
{ {
this.mainLanguage = Data.mainLanguage; this.mainLanguage = Data.mainLanguage;
this.mainMessagesPerPage = Data.mainMessagesPerPage; this.mainMessagesPerPage = Data.mainMessagesPerPage;
@ -57,12 +55,12 @@
this.isAnimationSupported = Globals.bAnimationSupported; 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); this.layout(Enums.Layout.NoPreview === this.layout() ? Enums.Layout.SidePreview : Enums.Layout.NoPreview);
}; };
SettingsGeneral.prototype.onBuild = function () GeneralAppSetting.prototype.onBuild = function ()
{ {
var self = this; var self = this;
@ -158,16 +156,16 @@
}, 50); }, 50);
}; };
SettingsGeneral.prototype.onShow = function () GeneralAppSetting.prototype.onShow = function ()
{ {
Data.desktopNotifications.valueHasMutated(); 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;
}()); }());

View file

@ -11,14 +11,14 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
HtmlEditor = require('Common/HtmlEditor'), HtmlEditor = require('Common/HtmlEditor'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote') Remote = require('Storage/App/Remote')
; ;
/** /**
* @constructor * @constructor
*/ */
function SettingsIdentities() function IdentitiesAppSetting()
{ {
this.editor = null; this.editor = null;
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender; this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
@ -100,7 +100,7 @@
* *
* @return {string} * @return {string}
*/ */
SettingsIdentities.prototype.formattedAccountIdentity = function () IdentitiesAppSetting.prototype.formattedAccountIdentity = function ()
{ {
var var
sDisplayName = this.displayName.peek(), sDisplayName = this.displayName.peek(),
@ -110,20 +110,20 @@
return '' === sDisplayName ? sEmail : '"' + Utils.quoteName(sDisplayName) + '" <' + sEmail + '>'; 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 * @param {IdentityModel} oIdentityToRemove
*/ */
SettingsIdentities.prototype.deleteIdentity = function (oIdentityToRemove) IdentitiesAppSetting.prototype.deleteIdentity = function (oIdentityToRemove)
{ {
if (oIdentityToRemove && oIdentityToRemove.deleteAccess()) if (oIdentityToRemove && oIdentityToRemove.deleteAccess())
{ {
@ -140,13 +140,13 @@
this.identities.remove(fRemoveFolder); this.identities.remove(fRemoveFolder);
Remote.identityDelete(function () { Remote.identityDelete(function () {
require('App:RainLoop').accountsAndIdentities(); require('App/App').accountsAndIdentities();
}, oIdentityToRemove.id); }, oIdentityToRemove.id);
} }
} }
}; };
SettingsIdentities.prototype.onFocus = function () IdentitiesAppSetting.prototype.onFocus = function ()
{ {
if (!this.editor && this.signatureDom()) if (!this.editor && this.signatureDom())
{ {
@ -172,7 +172,7 @@
} }
}; };
SettingsIdentities.prototype.onBuild = function (oDom) IdentitiesAppSetting.prototype.onBuild = function (oDom)
{ {
var self = this; var self = this;
@ -228,6 +228,6 @@
}, 50); }, 50);
}; };
module.exports = SettingsIdentities; module.exports = IdentitiesAppSetting;
}()); }());

View file

@ -11,14 +11,14 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
HtmlEditor = require('Common/HtmlEditor'), HtmlEditor = require('Common/HtmlEditor'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote') Remote = require('Storage/App/Remote')
; ;
/** /**
* @constructor * @constructor
*/ */
function SettingsIdentity() function IdentityAppSetting()
{ {
this.editor = null; this.editor = null;
@ -34,7 +34,7 @@
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle); this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
} }
SettingsIdentity.prototype.onFocus = function () IdentityAppSetting.prototype.onFocus = function ()
{ {
if (!this.editor && this.signatureDom()) if (!this.editor && this.signatureDom())
{ {
@ -60,7 +60,7 @@
} }
}; };
SettingsIdentity.prototype.onBuild = function () IdentityAppSetting.prototype.onBuild = function ()
{ {
var self = this; var self = this;
_.delay(function () { _.delay(function () {
@ -98,6 +98,6 @@
}, 50); }, 50);
}; };
module.exports = SettingsIdentity; module.exports = IdentityAppSetting;
}()); }());

View file

@ -6,15 +6,15 @@
var var
ko = require('ko'), ko = require('ko'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
Data = require('Storage:RainLoop:Data') Data = require('Storage/App/Data')
; ;
/** /**
* @constructor * @constructor
*/ */
function SettingsOpenPGP() function OpenPGPAppSetting()
{ {
this.openpgpkeys = Data.openpgpkeys; this.openpgpkeys = Data.openpgpkeys;
this.openpgpkeysPublic = Data.openpgpkeysPublic; 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) if (oOpenPgpKey)
{ {
kn.showScreenPopup(require('View:Popup:ViewOpenPgpKey'), [oOpenPgpKey]); kn.showScreenPopup(require('View/Popup/ViewOpenPgpKey'), [oOpenPgpKey]);
} }
}; };
/** /**
* @param {OpenPgpKeyModel} oOpenPgpKeyToRemove * @param {OpenPgpKeyModel} oOpenPgpKeyToRemove
*/ */
SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove) OpenPGPAppSetting.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
{ {
if (oOpenPgpKeyToRemove && oOpenPgpKeyToRemove.deleteAccess()) if (oOpenPgpKeyToRemove && oOpenPgpKeyToRemove.deleteAccess())
{ {
@ -73,11 +73,11 @@
Data.openpgpKeyring.store(); Data.openpgpKeyring.store();
require('App:RainLoop').reloadOpenPgpKeys(); require('App/App').reloadOpenPgpKeys();
} }
} }
}; };
module.exports = SettingsOpenPGP; module.exports = OpenPGPAppSetting;
}()); }());

View file

@ -10,13 +10,13 @@
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Remote = require('Storage:RainLoop:Remote') Remote = require('Storage/App/Remote')
; ;
/** /**
* @constructor * @constructor
*/ */
function SettingsSecurity() function SecurityAppSetting()
{ {
this.processing = ko.observable(false); this.processing = ko.observable(false);
this.clearing = ko.observable(false); this.clearing = ko.observable(false);
@ -46,37 +46,37 @@
this.onSecretResult = _.bind(this.onSecretResult, this); this.onSecretResult = _.bind(this.onSecretResult, this);
} }
SettingsSecurity.prototype.showSecret = function () SecurityAppSetting.prototype.showSecret = function ()
{ {
this.secreting(true); this.secreting(true);
Remote.showTwoFactorSecret(this.onSecretResult); Remote.showTwoFactorSecret(this.onSecretResult);
}; };
SettingsSecurity.prototype.hideSecret = function () SecurityAppSetting.prototype.hideSecret = function ()
{ {
this.viewSecret(''); this.viewSecret('');
this.viewBackupCodes(''); this.viewBackupCodes('');
this.viewUrl(''); this.viewUrl('');
}; };
SettingsSecurity.prototype.createTwoFactor = function () SecurityAppSetting.prototype.createTwoFactor = function ()
{ {
this.processing(true); this.processing(true);
Remote.createTwoFactor(this.onResult); Remote.createTwoFactor(this.onResult);
}; };
SettingsSecurity.prototype.enableTwoFactor = function () SecurityAppSetting.prototype.enableTwoFactor = function ()
{ {
this.processing(true); this.processing(true);
Remote.enableTwoFactor(this.onResult, this.viewEnable()); 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.viewSecret('');
this.viewBackupCodes(''); this.viewBackupCodes('');
@ -86,14 +86,14 @@
Remote.clearTwoFactor(this.onResult); Remote.clearTwoFactor(this.onResult);
}; };
SettingsSecurity.prototype.onShow = function () SecurityAppSetting.prototype.onShow = function ()
{ {
this.viewSecret(''); this.viewSecret('');
this.viewBackupCodes(''); this.viewBackupCodes('');
this.viewUrl(''); this.viewUrl('');
}; };
SettingsSecurity.prototype.onResult = function (sResult, oData) SecurityAppSetting.prototype.onResult = function (sResult, oData)
{ {
this.processing(false); this.processing(false);
this.clearing(false); this.clearing(false);
@ -139,7 +139,7 @@
} }
}; };
SettingsSecurity.prototype.onSecretResult = function (sResult, oData) SecurityAppSetting.prototype.onSecretResult = function (sResult, oData)
{ {
this.secreting(false); this.secreting(false);
@ -155,12 +155,12 @@
} }
}; };
SettingsSecurity.prototype.onBuild = function () SecurityAppSetting.prototype.onBuild = function ()
{ {
this.processing(true); this.processing(true);
Remote.getTwoFactor(this.onResult); Remote.getTwoFactor(this.onResult);
}; };
module.exports = SettingsSecurity; module.exports = SecurityAppSetting;
}()); }());

View file

@ -6,11 +6,11 @@
/** /**
* @constructor * @constructor
*/ */
function SettingsSocial() function SocialAppSetting()
{ {
var var
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Data = require('Storage:RainLoop:Data') Data = require('Storage/App/Data')
; ;
this.googleEnable = Data.googleEnable; this.googleEnable = Data.googleEnable;
@ -34,43 +34,43 @@
this.connectGoogle = Utils.createCommand(this, function () { this.connectGoogle = Utils.createCommand(this, function () {
if (!this.googleLoggined()) if (!this.googleLoggined())
{ {
require('App:RainLoop').googleConnect(); require('App/App').googleConnect();
} }
}, function () { }, function () {
return !this.googleLoggined() && !this.googleActions(); return !this.googleLoggined() && !this.googleActions();
}); });
this.disconnectGoogle = Utils.createCommand(this, function () { this.disconnectGoogle = Utils.createCommand(this, function () {
require('App:RainLoop').googleDisconnect(); require('App/App').googleDisconnect();
}); });
this.connectFacebook = Utils.createCommand(this, function () { this.connectFacebook = Utils.createCommand(this, function () {
if (!this.facebookLoggined()) if (!this.facebookLoggined())
{ {
require('App:RainLoop').facebookConnect(); require('App/App').facebookConnect();
} }
}, function () { }, function () {
return !this.facebookLoggined() && !this.facebookActions(); return !this.facebookLoggined() && !this.facebookActions();
}); });
this.disconnectFacebook = Utils.createCommand(this, function () { this.disconnectFacebook = Utils.createCommand(this, function () {
require('App:RainLoop').facebookDisconnect(); require('App/App').facebookDisconnect();
}); });
this.connectTwitter = Utils.createCommand(this, function () { this.connectTwitter = Utils.createCommand(this, function () {
if (!this.twitterLoggined()) if (!this.twitterLoggined())
{ {
require('App:RainLoop').twitterConnect(); require('App/App').twitterConnect();
} }
}, function () { }, function () {
return !this.twitterLoggined() && !this.twitterActions(); return !this.twitterLoggined() && !this.twitterActions();
}); });
this.disconnectTwitter = Utils.createCommand(this, function () { this.disconnectTwitter = Utils.createCommand(this, function () {
require('App:RainLoop').twitterDisconnect(); require('App/App').twitterDisconnect();
}); });
} }
module.exports = SettingsSocial; module.exports = SocialAppSetting;
}()); }());

View file

@ -13,14 +13,14 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote') Remote = require('Storage/App/Remote')
; ;
/** /**
* @constructor * @constructor
*/ */
function SettingsThemes() function ThemesAppSetting()
{ {
var self = this; var self = this;
@ -114,7 +114,7 @@
}, this); }, this);
} }
SettingsThemes.prototype.onBuild = function () ThemesAppSetting.prototype.onBuild = function ()
{ {
var sCurrentTheme = Data.theme(); var sCurrentTheme = Data.theme();
this.themesObjects(_.map(Data.themes(), function (sTheme) { this.themesObjects(_.map(Data.themes(), function (sTheme) {
@ -127,6 +127,6 @@
})); }));
}; };
module.exports = SettingsThemes; module.exports = ThemesAppSetting;
}()); }());

View file

@ -8,18 +8,18 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Settings = require('Storage:Settings') Settings = require('Storage/Settings')
; ;
/** /**
* @constructor * @constructor
*/ */
function AbstractData() function AbstractDataStorate()
{ {
Utils.initDataConstructorBySettings(this); Utils.initDataConstructorBySettings(this);
} }
AbstractData.prototype.populateDataOnStart = function() AbstractDataStorate.prototype.populateDataOnStart = function()
{ {
var var
mLayout = Utils.pInt(Settings.settingsGet('Layout')), mLayout = Utils.pInt(Settings.settingsGet('Layout')),
@ -88,6 +88,6 @@
this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed')); this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed'));
}; };
module.exports = AbstractData; module.exports = AbstractDataStorate;
}()); }());

View file

@ -16,7 +16,7 @@
Plugins = require('Common/Plugins'), Plugins = require('Common/Plugins'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Settings = require('Storage:Settings') Settings = require('Storage/Settings')
; ;
/** /**

View file

@ -8,14 +8,14 @@
_ = require('_'), _ = require('_'),
ko = require('ko'), ko = require('ko'),
AbstractData = require('Storage:Abstract:Data') AbstractData = require('Storage/AbstractData')
; ;
/** /**
* @constructor * @constructor
* @extends AbstractData * @extends AbstractData
*/ */
function AdminDataStorage() function DataAdminStorage()
{ {
AbstractData.call(this); AbstractData.call(this);
@ -56,13 +56,13 @@
}, this).extend({'rateLimit': 300}); }, 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); AbstractData.prototype.populateDataOnStart.call(this);
}; };
module.exports = new AdminDataStorage(); module.exports = new DataAdminStorage();
}()); }());

View file

@ -1,34 +1,34 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function () { (function () {
'use strict'; 'use strict';
var var
_ = require('_'), _ = require('_'),
AbstractRemoteStorage = require('Storage:Abstract:Remote') AbstractRemoteStorage = require('Storage/AbstractRemote')
; ;
/** /**
* @constructor * @constructor
* @extends AbstractRemoteStorage * @extends AbstractRemoteStorage
*/ */
function AdminRemoteStorage() function RemoteAdminStorage()
{ {
AbstractRemoteStorage.call(this); AbstractRemoteStorage.call(this);
this.oRequests = {}; this.oRequests = {};
} }
_.extend(AdminRemoteStorage.prototype, AbstractRemoteStorage.prototype); _.extend(RemoteAdminStorage.prototype, AbstractRemoteStorage.prototype);
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {string} sLogin * @param {string} sLogin
* @param {string} sPassword * @param {string} sPassword
*/ */
AdminRemoteStorage.prototype.adminLogin = function (fCallback, sLogin, sPassword) RemoteAdminStorage.prototype.adminLogin = function (fCallback, sLogin, sPassword)
{ {
this.defaultRequest(fCallback, 'AdminLogin', { this.defaultRequest(fCallback, 'AdminLogin', {
'Login': sLogin, 'Login': sLogin,
@ -39,7 +39,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
AdminRemoteStorage.prototype.adminLogout = function (fCallback) RemoteAdminStorage.prototype.adminLogout = function (fCallback)
{ {
this.defaultRequest(fCallback, 'AdminLogout'); this.defaultRequest(fCallback, 'AdminLogout');
}; };
@ -48,7 +48,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {?} oData * @param {?} oData
*/ */
AdminRemoteStorage.prototype.saveAdminConfig = function (fCallback, oData) RemoteAdminStorage.prototype.saveAdminConfig = function (fCallback, oData)
{ {
this.defaultRequest(fCallback, 'AdminSettingsUpdate', oData); this.defaultRequest(fCallback, 'AdminSettingsUpdate', oData);
}; };
@ -56,7 +56,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
AdminRemoteStorage.prototype.domainList = function (fCallback) RemoteAdminStorage.prototype.domainList = function (fCallback)
{ {
this.defaultRequest(fCallback, 'AdminDomainList'); this.defaultRequest(fCallback, 'AdminDomainList');
}; };
@ -64,7 +64,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
AdminRemoteStorage.prototype.pluginList = function (fCallback) RemoteAdminStorage.prototype.pluginList = function (fCallback)
{ {
this.defaultRequest(fCallback, 'AdminPluginList'); this.defaultRequest(fCallback, 'AdminPluginList');
}; };
@ -72,7 +72,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
AdminRemoteStorage.prototype.packagesList = function (fCallback) RemoteAdminStorage.prototype.packagesList = function (fCallback)
{ {
this.defaultRequest(fCallback, 'AdminPackagesList'); this.defaultRequest(fCallback, 'AdminPackagesList');
}; };
@ -80,7 +80,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
AdminRemoteStorage.prototype.coreData = function (fCallback) RemoteAdminStorage.prototype.coreData = function (fCallback)
{ {
this.defaultRequest(fCallback, 'AdminCoreData'); this.defaultRequest(fCallback, 'AdminCoreData');
}; };
@ -88,7 +88,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
AdminRemoteStorage.prototype.updateCoreData = function (fCallback) RemoteAdminStorage.prototype.updateCoreData = function (fCallback)
{ {
this.defaultRequest(fCallback, 'AdminUpdateCoreData', {}, 90000); this.defaultRequest(fCallback, 'AdminUpdateCoreData', {}, 90000);
}; };
@ -97,7 +97,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {Object} oPackage * @param {Object} oPackage
*/ */
AdminRemoteStorage.prototype.packageInstall = function (fCallback, oPackage) RemoteAdminStorage.prototype.packageInstall = function (fCallback, oPackage)
{ {
this.defaultRequest(fCallback, 'AdminPackageInstall', { this.defaultRequest(fCallback, 'AdminPackageInstall', {
'Id': oPackage.id, 'Id': oPackage.id,
@ -110,7 +110,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {Object} oPackage * @param {Object} oPackage
*/ */
AdminRemoteStorage.prototype.packageDelete = function (fCallback, oPackage) RemoteAdminStorage.prototype.packageDelete = function (fCallback, oPackage)
{ {
this.defaultRequest(fCallback, 'AdminPackageDelete', { this.defaultRequest(fCallback, 'AdminPackageDelete', {
'Id': oPackage.id 'Id': oPackage.id
@ -121,7 +121,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {string} sName * @param {string} sName
*/ */
AdminRemoteStorage.prototype.domain = function (fCallback, sName) RemoteAdminStorage.prototype.domain = function (fCallback, sName)
{ {
this.defaultRequest(fCallback, 'AdminDomainLoad', { this.defaultRequest(fCallback, 'AdminDomainLoad', {
'Name': sName 'Name': sName
@ -132,7 +132,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {string} sName * @param {string} sName
*/ */
AdminRemoteStorage.prototype.plugin = function (fCallback, sName) RemoteAdminStorage.prototype.plugin = function (fCallback, sName)
{ {
this.defaultRequest(fCallback, 'AdminPluginLoad', { this.defaultRequest(fCallback, 'AdminPluginLoad', {
'Name': sName 'Name': sName
@ -143,7 +143,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {string} sName * @param {string} sName
*/ */
AdminRemoteStorage.prototype.domainDelete = function (fCallback, sName) RemoteAdminStorage.prototype.domainDelete = function (fCallback, sName)
{ {
this.defaultRequest(fCallback, 'AdminDomainDelete', { this.defaultRequest(fCallback, 'AdminDomainDelete', {
'Name': sName 'Name': sName
@ -155,7 +155,7 @@
* @param {string} sName * @param {string} sName
* @param {boolean} bDisabled * @param {boolean} bDisabled
*/ */
AdminRemoteStorage.prototype.domainDisable = function (fCallback, sName, bDisabled) RemoteAdminStorage.prototype.domainDisable = function (fCallback, sName, bDisabled)
{ {
return this.defaultRequest(fCallback, 'AdminDomainDisable', { return this.defaultRequest(fCallback, 'AdminDomainDisable', {
'Name': sName, 'Name': sName,
@ -167,7 +167,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {Object} oConfig * @param {Object} oConfig
*/ */
AdminRemoteStorage.prototype.pluginSettingsUpdate = function (fCallback, oConfig) RemoteAdminStorage.prototype.pluginSettingsUpdate = function (fCallback, oConfig)
{ {
return this.defaultRequest(fCallback, 'AdminPluginSettingsUpdate', oConfig); return this.defaultRequest(fCallback, 'AdminPluginSettingsUpdate', oConfig);
}; };
@ -176,7 +176,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {boolean} bForce * @param {boolean} bForce
*/ */
AdminRemoteStorage.prototype.licensing = function (fCallback, bForce) RemoteAdminStorage.prototype.licensing = function (fCallback, bForce)
{ {
return this.defaultRequest(fCallback, 'AdminLicensing', { return this.defaultRequest(fCallback, 'AdminLicensing', {
'Force' : bForce ? '1' : '0' 'Force' : bForce ? '1' : '0'
@ -188,7 +188,7 @@
* @param {string} sDomain * @param {string} sDomain
* @param {string} sKey * @param {string} sKey
*/ */
AdminRemoteStorage.prototype.licensingActivate = function (fCallback, sDomain, sKey) RemoteAdminStorage.prototype.licensingActivate = function (fCallback, sDomain, sKey)
{ {
return this.defaultRequest(fCallback, 'AdminLicensingActivate', { return this.defaultRequest(fCallback, 'AdminLicensingActivate', {
'Domain' : sDomain, 'Domain' : sDomain,
@ -201,7 +201,7 @@
* @param {string} sName * @param {string} sName
* @param {boolean} bDisabled * @param {boolean} bDisabled
*/ */
AdminRemoteStorage.prototype.pluginDisable = function (fCallback, sName, bDisabled) RemoteAdminStorage.prototype.pluginDisable = function (fCallback, sName, bDisabled)
{ {
return this.defaultRequest(fCallback, 'AdminPluginDisable', { return this.defaultRequest(fCallback, 'AdminPluginDisable', {
'Name': sName, 'Name': sName,
@ -209,7 +209,7 @@
}); });
}; };
AdminRemoteStorage.prototype.createOrUpdateDomain = function (fCallback, RemoteAdminStorage.prototype.createOrUpdateDomain = function (fCallback,
bCreate, sName, sIncHost, iIncPort, sIncSecure, bIncShortLogin, bCreate, sName, sIncHost, iIncPort, sIncSecure, bIncShortLogin,
sOutHost, iOutPort, sOutSecure, bOutShortLogin, bOutAuth, sWhiteList) 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, sIncHost, iIncPort, sIncSecure,
sOutHost, iOutPort, sOutSecure, bOutAuth) sOutHost, iOutPort, sOutSecure, bOutAuth)
{ {
@ -249,7 +249,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {?} oData * @param {?} oData
*/ */
AdminRemoteStorage.prototype.testContacts = function (fCallback, oData) RemoteAdminStorage.prototype.testContacts = function (fCallback, oData)
{ {
this.defaultRequest(fCallback, 'AdminContactsTest', oData); this.defaultRequest(fCallback, 'AdminContactsTest', oData);
}; };
@ -258,7 +258,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {?} oData * @param {?} oData
*/ */
AdminRemoteStorage.prototype.saveNewAdminPassword = function (fCallback, oData) RemoteAdminStorage.prototype.saveNewAdminPassword = function (fCallback, oData)
{ {
this.defaultRequest(fCallback, 'AdminPasswordUpdate', oData); this.defaultRequest(fCallback, 'AdminPasswordUpdate', oData);
}; };
@ -266,11 +266,11 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
AdminRemoteStorage.prototype.adminPing = function (fCallback) RemoteAdminStorage.prototype.adminPing = function (fCallback)
{ {
this.defaultRequest(fCallback, 'AdminPing'); this.defaultRequest(fCallback, 'AdminPing');
}; };
module.exports = new AdminRemoteStorage(); module.exports = new RemoteAdminStorage();
}()); }());

View file

@ -11,13 +11,13 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Settings = require('Storage:Settings') Settings = require('Storage/Settings')
; ;
/** /**
* @constructor * @constructor
*/ */
function CacheStorage() function CacheAppStorage()
{ {
this.oFoldersCache = {}; this.oFoldersCache = {};
this.oFoldersNamesCache = {}; this.oFoldersNamesCache = {};
@ -34,54 +34,54 @@
/** /**
* @type {boolean} * @type {boolean}
*/ */
CacheStorage.prototype.bCapaGravatar = false; CacheAppStorage.prototype.bCapaGravatar = false;
/** /**
* @type {Object} * @type {Object}
*/ */
CacheStorage.prototype.oFoldersCache = {}; CacheAppStorage.prototype.oFoldersCache = {};
/** /**
* @type {Object} * @type {Object}
*/ */
CacheStorage.prototype.oFoldersNamesCache = {}; CacheAppStorage.prototype.oFoldersNamesCache = {};
/** /**
* @type {Object} * @type {Object}
*/ */
CacheStorage.prototype.oFolderHashCache = {}; CacheAppStorage.prototype.oFolderHashCache = {};
/** /**
* @type {Object} * @type {Object}
*/ */
CacheStorage.prototype.oFolderUidNextCache = {}; CacheAppStorage.prototype.oFolderUidNextCache = {};
/** /**
* @type {Object} * @type {Object}
*/ */
CacheStorage.prototype.oMessageListHashCache = {}; CacheAppStorage.prototype.oMessageListHashCache = {};
/** /**
* @type {Object} * @type {Object}
*/ */
CacheStorage.prototype.oMessageFlagsCache = {}; CacheAppStorage.prototype.oMessageFlagsCache = {};
/** /**
* @type {Object} * @type {Object}
*/ */
CacheStorage.prototype.oBodies = {}; CacheAppStorage.prototype.oBodies = {};
/** /**
* @type {Object} * @type {Object}
*/ */
CacheStorage.prototype.oNewMessage = {}; CacheAppStorage.prototype.oNewMessage = {};
/** /**
* @type {Object} * @type {Object}
*/ */
CacheStorage.prototype.oRequestedMessage = {}; CacheAppStorage.prototype.oRequestedMessage = {};
CacheStorage.prototype.clear = function () CacheAppStorage.prototype.clear = function ()
{ {
this.oFoldersCache = {}; this.oFoldersCache = {};
this.oFoldersNamesCache = {}; this.oFoldersNamesCache = {};
@ -98,7 +98,7 @@
* @param {Function} fCallback * @param {Function} fCallback
* @return {string} * @return {string}
*/ */
CacheStorage.prototype.getUserPic = function (sEmail, fCallback) CacheAppStorage.prototype.getUserPic = function (sEmail, fCallback)
{ {
sEmail = Utils.trim(sEmail); sEmail = Utils.trim(sEmail);
fCallback(this.bCapaGravatar && '' !== sEmail ? LinkBuilder.avatarLink(sEmail) : '', sEmail); fCallback(this.bCapaGravatar && '' !== sEmail ? LinkBuilder.avatarLink(sEmail) : '', sEmail);
@ -109,7 +109,7 @@
* @param {string} sUid * @param {string} sUid
* @return {string} * @return {string}
*/ */
CacheStorage.prototype.getMessageKey = function (sFolderFullNameRaw, sUid) CacheAppStorage.prototype.getMessageKey = function (sFolderFullNameRaw, sUid)
{ {
return sFolderFullNameRaw + '#' + sUid; return sFolderFullNameRaw + '#' + sUid;
}; };
@ -118,7 +118,7 @@
* @param {string} sFolder * @param {string} sFolder
* @param {string} sUid * @param {string} sUid
*/ */
CacheStorage.prototype.addRequestedMessage = function (sFolder, sUid) CacheAppStorage.prototype.addRequestedMessage = function (sFolder, sUid)
{ {
this.oRequestedMessage[this.getMessageKey(sFolder, sUid)] = true; this.oRequestedMessage[this.getMessageKey(sFolder, sUid)] = true;
}; };
@ -128,7 +128,7 @@
* @param {string} sUid * @param {string} sUid
* @return {boolean} * @return {boolean}
*/ */
CacheStorage.prototype.hasRequestedMessage = function (sFolder, sUid) CacheAppStorage.prototype.hasRequestedMessage = function (sFolder, sUid)
{ {
return true === this.oRequestedMessage[this.getMessageKey(sFolder, sUid)]; return true === this.oRequestedMessage[this.getMessageKey(sFolder, sUid)];
}; };
@ -137,7 +137,7 @@
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
* @param {string} sUid * @param {string} sUid
*/ */
CacheStorage.prototype.addNewMessageCache = function (sFolderFullNameRaw, sUid) CacheAppStorage.prototype.addNewMessageCache = function (sFolderFullNameRaw, sUid)
{ {
this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)] = true; this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)] = true;
}; };
@ -146,7 +146,7 @@
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
* @param {string} sUid * @param {string} sUid
*/ */
CacheStorage.prototype.hasNewMessageAndRemoveFromCache = function (sFolderFullNameRaw, sUid) CacheAppStorage.prototype.hasNewMessageAndRemoveFromCache = function (sFolderFullNameRaw, sUid)
{ {
if (this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)]) if (this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)])
{ {
@ -157,7 +157,7 @@
return false; return false;
}; };
CacheStorage.prototype.clearNewMessageCache = function () CacheAppStorage.prototype.clearNewMessageCache = function ()
{ {
this.oNewMessage = {}; this.oNewMessage = {};
}; };
@ -166,7 +166,7 @@
* @param {string} sFolderHash * @param {string} sFolderHash
* @return {string} * @return {string}
*/ */
CacheStorage.prototype.getFolderFullNameRaw = function (sFolderHash) CacheAppStorage.prototype.getFolderFullNameRaw = function (sFolderHash)
{ {
return '' !== sFolderHash && this.oFoldersNamesCache[sFolderHash] ? this.oFoldersNamesCache[sFolderHash] : ''; return '' !== sFolderHash && this.oFoldersNamesCache[sFolderHash] ? this.oFoldersNamesCache[sFolderHash] : '';
}; };
@ -175,7 +175,7 @@
* @param {string} sFolderHash * @param {string} sFolderHash
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
*/ */
CacheStorage.prototype.setFolderFullNameRaw = function (sFolderHash, sFolderFullNameRaw) CacheAppStorage.prototype.setFolderFullNameRaw = function (sFolderHash, sFolderFullNameRaw)
{ {
this.oFoldersNamesCache[sFolderHash] = sFolderFullNameRaw; this.oFoldersNamesCache[sFolderHash] = sFolderFullNameRaw;
}; };
@ -184,7 +184,7 @@
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
* @return {string} * @return {string}
*/ */
CacheStorage.prototype.getFolderHash = function (sFolderFullNameRaw) CacheAppStorage.prototype.getFolderHash = function (sFolderFullNameRaw)
{ {
return '' !== sFolderFullNameRaw && this.oFolderHashCache[sFolderFullNameRaw] ? this.oFolderHashCache[sFolderFullNameRaw] : ''; return '' !== sFolderFullNameRaw && this.oFolderHashCache[sFolderFullNameRaw] ? this.oFolderHashCache[sFolderFullNameRaw] : '';
}; };
@ -193,7 +193,7 @@
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
* @param {string} sFolderHash * @param {string} sFolderHash
*/ */
CacheStorage.prototype.setFolderHash = function (sFolderFullNameRaw, sFolderHash) CacheAppStorage.prototype.setFolderHash = function (sFolderFullNameRaw, sFolderHash)
{ {
this.oFolderHashCache[sFolderFullNameRaw] = sFolderHash; this.oFolderHashCache[sFolderFullNameRaw] = sFolderHash;
}; };
@ -202,7 +202,7 @@
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
* @return {string} * @return {string}
*/ */
CacheStorage.prototype.getFolderUidNext = function (sFolderFullNameRaw) CacheAppStorage.prototype.getFolderUidNext = function (sFolderFullNameRaw)
{ {
return '' !== sFolderFullNameRaw && this.oFolderUidNextCache[sFolderFullNameRaw] ? this.oFolderUidNextCache[sFolderFullNameRaw] : ''; return '' !== sFolderFullNameRaw && this.oFolderUidNextCache[sFolderFullNameRaw] ? this.oFolderUidNextCache[sFolderFullNameRaw] : '';
}; };
@ -211,7 +211,7 @@
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
* @param {string} sUidNext * @param {string} sUidNext
*/ */
CacheStorage.prototype.setFolderUidNext = function (sFolderFullNameRaw, sUidNext) CacheAppStorage.prototype.setFolderUidNext = function (sFolderFullNameRaw, sUidNext)
{ {
this.oFolderUidNextCache[sFolderFullNameRaw] = sUidNext; this.oFolderUidNextCache[sFolderFullNameRaw] = sUidNext;
}; };
@ -220,7 +220,7 @@
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
* @return {?FolderModel} * @return {?FolderModel}
*/ */
CacheStorage.prototype.getFolderFromCacheList = function (sFolderFullNameRaw) CacheAppStorage.prototype.getFolderFromCacheList = function (sFolderFullNameRaw)
{ {
return '' !== sFolderFullNameRaw && this.oFoldersCache[sFolderFullNameRaw] ? this.oFoldersCache[sFolderFullNameRaw] : null; return '' !== sFolderFullNameRaw && this.oFoldersCache[sFolderFullNameRaw] ? this.oFoldersCache[sFolderFullNameRaw] : null;
}; };
@ -229,7 +229,7 @@
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
* @param {?FolderModel} oFolder * @param {?FolderModel} oFolder
*/ */
CacheStorage.prototype.setFolderToCacheList = function (sFolderFullNameRaw, oFolder) CacheAppStorage.prototype.setFolderToCacheList = function (sFolderFullNameRaw, oFolder)
{ {
this.oFoldersCache[sFolderFullNameRaw] = oFolder; this.oFoldersCache[sFolderFullNameRaw] = oFolder;
}; };
@ -237,7 +237,7 @@
/** /**
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
*/ */
CacheStorage.prototype.removeFolderFromCacheList = function (sFolderFullNameRaw) CacheAppStorage.prototype.removeFolderFromCacheList = function (sFolderFullNameRaw)
{ {
this.setFolderToCacheList(sFolderFullNameRaw, null); this.setFolderToCacheList(sFolderFullNameRaw, null);
}; };
@ -247,7 +247,7 @@
* @param {string} sUid * @param {string} sUid
* @return {?Array} * @return {?Array}
*/ */
CacheStorage.prototype.getMessageFlagsFromCache = function (sFolderFullName, sUid) CacheAppStorage.prototype.getMessageFlagsFromCache = function (sFolderFullName, sUid)
{ {
return this.oMessageFlagsCache[sFolderFullName] && this.oMessageFlagsCache[sFolderFullName][sUid] ? return this.oMessageFlagsCache[sFolderFullName] && this.oMessageFlagsCache[sFolderFullName][sUid] ?
this.oMessageFlagsCache[sFolderFullName][sUid] : null; this.oMessageFlagsCache[sFolderFullName][sUid] : null;
@ -258,7 +258,7 @@
* @param {string} sUid * @param {string} sUid
* @param {Array} aFlagsCache * @param {Array} aFlagsCache
*/ */
CacheStorage.prototype.setMessageFlagsToCache = function (sFolderFullName, sUid, aFlagsCache) CacheAppStorage.prototype.setMessageFlagsToCache = function (sFolderFullName, sUid, aFlagsCache)
{ {
if (!this.oMessageFlagsCache[sFolderFullName]) if (!this.oMessageFlagsCache[sFolderFullName])
{ {
@ -271,7 +271,7 @@
/** /**
* @param {string} sFolderFullName * @param {string} sFolderFullName
*/ */
CacheStorage.prototype.clearMessageFlagsFromCacheByFolder = function (sFolderFullName) CacheAppStorage.prototype.clearMessageFlagsFromCacheByFolder = function (sFolderFullName)
{ {
this.oMessageFlagsCache[sFolderFullName] = {}; this.oMessageFlagsCache[sFolderFullName] = {};
}; };
@ -279,7 +279,7 @@
/** /**
* @param {(MessageModel|null)} oMessage * @param {(MessageModel|null)} oMessage
*/ */
CacheStorage.prototype.initMessageFlagsFromCache = function (oMessage) CacheAppStorage.prototype.initMessageFlagsFromCache = function (oMessage)
{ {
if (oMessage) if (oMessage)
{ {
@ -320,7 +320,7 @@
/** /**
* @param {(MessageModel|null)} oMessage * @param {(MessageModel|null)} oMessage
*/ */
CacheStorage.prototype.storeMessageFlagsToCache = function (oMessage) CacheAppStorage.prototype.storeMessageFlagsToCache = function (oMessage)
{ {
if (oMessage) if (oMessage)
{ {
@ -336,7 +336,7 @@
* @param {string} sUid * @param {string} sUid
* @param {Array} aFlags * @param {Array} aFlags
*/ */
CacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function (sFolder, sUid, aFlags) CacheAppStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function (sFolder, sUid, aFlags)
{ {
if (Utils.isArray(aFlags) && 0 < aFlags.length) if (Utils.isArray(aFlags) && 0 < aFlags.length)
{ {
@ -344,6 +344,6 @@
} }
}; };
module.exports = new CacheStorage(); module.exports = new CacheAppStorage();
}()); }());

View file

@ -17,22 +17,22 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Cache = require('Storage:RainLoop:Cache'), Cache = require('Storage/App/Cache'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
MessageModel = require('Model/Message'), MessageModel = require('Model/Message'),
LocalStorage = require('Storage:LocalStorage'), Local = require('Storage/Local'),
AbstractData = require('Storage:Abstract:Data') AbstractData = require('Storage/AbstractData')
; ;
/** /**
* @constructor * @constructor
* @extends AbstractData * @extends AbstractData
*/ */
function DataStorage() function DataAppStorage()
{ {
AbstractData.call(this); AbstractData.call(this);
@ -323,7 +323,7 @@
if (Enums.Layout.NoPreview === this.layout() && if (Enums.Layout.NoPreview === this.layout() &&
-1 < window.location.hash.indexOf('message-preview')) -1 < window.location.hash.indexOf('message-preview'))
{ {
require('App:RainLoop').historyBack(); require('App/App').historyBack();
} }
} }
else if (Enums.Layout.NoPreview === this.layout()) else if (Enums.Layout.NoPreview === this.layout())
@ -471,9 +471,9 @@
this.purgeMessageBodyCacheThrottle = _.throttle(this.purgeMessageBodyCache, 1000 * 30); 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 var
iCount = 0, iCount = 0,
@ -505,7 +505,7 @@
} }
}; };
DataStorage.prototype.populateDataOnStart = function() DataAppStorage.prototype.populateDataOnStart = function()
{ {
AbstractData.prototype.populateDataOnStart.call(this); AbstractData.prototype.populateDataOnStart.call(this);
@ -522,7 +522,7 @@
this.signatureToAll(!!Settings.settingsGet('SignatureToAll')); this.signatureToAll(!!Settings.settingsGet('SignatureToAll'));
this.enableTwoFactor(!!Settings.settingsGet('EnableTwoFactor')); this.enableTwoFactor(!!Settings.settingsGet('EnableTwoFactor'));
this.lastFoldersHash = LocalStorage.get(Enums.ClientSideKeyName.FoldersLashHash) || ''; this.lastFoldersHash = Local.get(Enums.ClientSideKeyName.FoldersLashHash) || '';
this.remoteSuggestions = !!Settings.settingsGet('RemoteSuggestions'); this.remoteSuggestions = !!Settings.settingsGet('RemoteSuggestions');
@ -530,7 +530,7 @@
this.devPassword = Settings.settingsGet('DevPassword'); 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 !== '') if ('INBOX' === sFolder && Utils.isNormal(sUidNext) && sUidNext !== '')
{ {
@ -609,7 +609,7 @@
} }
}; };
DataStorage.prototype.hideMessageBodies = function () DataAppStorage.prototype.hideMessageBodies = function ()
{ {
var oMessagesBodiesDom = this.messagesBodiesDom(); var oMessagesBodiesDom = this.messagesBodiesDom();
if (oMessagesBodiesDom) if (oMessagesBodiesDom)
@ -622,7 +622,7 @@
* @param {boolean=} bBoot = false * @param {boolean=} bBoot = false
* @returns {Array} * @returns {Array}
*/ */
DataStorage.prototype.getNextFolderNames = function (bBoot) DataAppStorage.prototype.getNextFolderNames = function (bBoot)
{ {
bBoot = Utils.isUnd(bBoot) ? false : !!bBoot; bBoot = Utils.isUnd(bBoot) ? false : !!bBoot;
@ -685,7 +685,7 @@
* @param {string=} sToFolderFullNameRaw = '' * @param {string=} sToFolderFullNameRaw = ''
* @param {bCopy=} bCopy = false * @param {bCopy=} bCopy = false
*/ */
DataStorage.prototype.removeMessagesFromList = function ( DataAppStorage.prototype.removeMessagesFromList = function (
sFromFolderFullNameRaw, aUidForRemove, sToFolderFullNameRaw, bCopy) sFromFolderFullNameRaw, aUidForRemove, sToFolderFullNameRaw, bCopy)
{ {
sToFolderFullNameRaw = Utils.isNormal(sToFolderFullNameRaw) ? sToFolderFullNameRaw : ''; sToFolderFullNameRaw = Utils.isNormal(sToFolderFullNameRaw) ? sToFolderFullNameRaw : '';
@ -782,7 +782,7 @@
/** /**
* @param {Object} oMessageTextBody * @param {Object} oMessageTextBody
*/ */
DataStorage.prototype.initBlockquoteSwitcher = function (oMessageTextBody) DataAppStorage.prototype.initBlockquoteSwitcher = function (oMessageTextBody)
{ {
if (oMessageTextBody) if (oMessageTextBody)
{ {
@ -814,10 +814,9 @@
} }
}; };
DataStorage.prototype.setMessage = function (oData, bCached) DataAppStorage.prototype.setMessage = function (oData, bCached)
{ {
var var
self = this,
bIsHtml = false, bIsHtml = false,
bHasExternals = false, bHasExternals = false,
bHasInternals = false, bHasInternals = false,
@ -961,7 +960,7 @@
Cache.initMessageFlagsFromCache(oMessage); Cache.initMessageFlagsFromCache(oMessage);
if (oMessage.unseen()) if (oMessage.unseen())
{ {
require('App:RainLoop').setMessageSeen(oMessage); require('App/App').setMessageSeen(oMessage);
} }
Utils.windowResize(); Utils.windowResize();
@ -972,21 +971,21 @@
* @param {Array} aList * @param {Array} aList
* @returns {string} * @returns {string}
*/ */
DataStorage.prototype.calculateMessageListHash = function (aList) DataAppStorage.prototype.calculateMessageListHash = function (aList)
{ {
return _.map(aList, function (oMessage) { return _.map(aList, function (oMessage) {
return '' + oMessage.hash + '_' + oMessage.threadsLen() + '_' + oMessage.flagHash(); return '' + oMessage.hash + '_' + oMessage.threadsLen() + '_' + oMessage.flagHash();
}).join('|'); }).join('|');
}; };
DataStorage.prototype.findPublicKeyByHex = function (sHash) DataAppStorage.prototype.findPublicKeyByHex = function (sHash)
{ {
return _.find(this.openpgpkeysPublic(), function (oItem) { return _.find(this.openpgpkeysPublic(), function (oItem) {
return oItem && sHash === oItem.id; return oItem && sHash === oItem.id;
}); });
}; };
DataStorage.prototype.findPublicKeysByEmail = function (sEmail) DataAppStorage.prototype.findPublicKeysByEmail = function (sEmail)
{ {
var self = this; var self = this;
return _.compact(_.map(this.openpgpkeysPublic(), function (oItem) { return _.compact(_.map(this.openpgpkeysPublic(), function (oItem) {
@ -1015,7 +1014,7 @@
* @param {string=} sPassword * @param {string=} sPassword
* @returns {?} * @returns {?}
*/ */
DataStorage.prototype.findPrivateKeyByEmail = function (sEmail, sPassword) DataAppStorage.prototype.findPrivateKeyByEmail = function (sEmail, sPassword)
{ {
var var
self = this, self = this,
@ -1053,11 +1052,11 @@
* @param {string=} sPassword * @param {string=} sPassword
* @returns {?} * @returns {?}
*/ */
DataStorage.prototype.findSelfPrivateKey = function (sPassword) DataAppStorage.prototype.findSelfPrivateKey = function (sPassword)
{ {
return this.findPrivateKeyByEmail(this.accountEmail(), sPassword); return this.findPrivateKeyByEmail(this.accountEmail(), sPassword);
}; };
module.exports = new DataStorage(); module.exports = new DataAppStorage();
}()); }());

View file

@ -9,33 +9,32 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Consts = require('Common/Consts'), Consts = require('Common/Consts'),
Globals = require('Common/Globals'),
Base64 = require('Common/Base64'), Base64 = require('Common/Base64'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Cache = require('Storage:RainLoop:Cache'), Cache = require('Storage/App/Cache'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
AbstractRemoteStorage = require('Storage:Abstract:Remote') AbstractRemoteStorage = require('Storage/AbstractRemote')
; ;
/** /**
* @constructor * @constructor
* @extends AbstractRemoteStorage * @extends AbstractRemoteStorage
*/ */
function RemoteStorage() function RemoteAppStorage()
{ {
AbstractRemoteStorage.call(this); AbstractRemoteStorage.call(this);
this.oRequests = {}; this.oRequests = {};
} }
_.extend(RemoteStorage.prototype, AbstractRemoteStorage.prototype); _.extend(RemoteAppStorage.prototype, AbstractRemoteStorage.prototype);
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.folders = function (fCallback) RemoteAppStorage.prototype.folders = function (fCallback)
{ {
this.defaultRequest(fCallback, 'Folders', { this.defaultRequest(fCallback, 'Folders', {
'SentFolder': Settings.settingsGet('SentFolder'), 'SentFolder': Settings.settingsGet('SentFolder'),
@ -56,7 +55,7 @@
* @param {string=} sAdditionalCode * @param {string=} sAdditionalCode
* @param {boolean=} bAdditionalCodeSignMe * @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', { this.defaultRequest(fCallback, 'Login', {
'Email': sEmail, 'Email': sEmail,
@ -72,7 +71,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.getTwoFactor = function (fCallback) RemoteAppStorage.prototype.getTwoFactor = function (fCallback)
{ {
this.defaultRequest(fCallback, 'GetTwoFactorInfo'); this.defaultRequest(fCallback, 'GetTwoFactorInfo');
}; };
@ -80,7 +79,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.createTwoFactor = function (fCallback) RemoteAppStorage.prototype.createTwoFactor = function (fCallback)
{ {
this.defaultRequest(fCallback, 'CreateTwoFactorSecret'); this.defaultRequest(fCallback, 'CreateTwoFactorSecret');
}; };
@ -88,7 +87,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.clearTwoFactor = function (fCallback) RemoteAppStorage.prototype.clearTwoFactor = function (fCallback)
{ {
this.defaultRequest(fCallback, 'ClearTwoFactorInfo'); this.defaultRequest(fCallback, 'ClearTwoFactorInfo');
}; };
@ -96,7 +95,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.showTwoFactorSecret = function (fCallback) RemoteAppStorage.prototype.showTwoFactorSecret = function (fCallback)
{ {
this.defaultRequest(fCallback, 'ShowTwoFactorSecret'); this.defaultRequest(fCallback, 'ShowTwoFactorSecret');
}; };
@ -105,7 +104,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {string} sCode * @param {string} sCode
*/ */
RemoteStorage.prototype.testTwoFactor = function (fCallback, sCode) RemoteAppStorage.prototype.testTwoFactor = function (fCallback, sCode)
{ {
this.defaultRequest(fCallback, 'TestTwoFactorInfo', { this.defaultRequest(fCallback, 'TestTwoFactorInfo', {
'Code': sCode 'Code': sCode
@ -116,7 +115,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {boolean} bEnable * @param {boolean} bEnable
*/ */
RemoteStorage.prototype.enableTwoFactor = function (fCallback, bEnable) RemoteAppStorage.prototype.enableTwoFactor = function (fCallback, bEnable)
{ {
this.defaultRequest(fCallback, 'EnableTwoFactor', { this.defaultRequest(fCallback, 'EnableTwoFactor', {
'Enable': bEnable ? '1' : '0' 'Enable': bEnable ? '1' : '0'
@ -126,7 +125,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.clearTwoFactorInfo = function (fCallback) RemoteAppStorage.prototype.clearTwoFactorInfo = function (fCallback)
{ {
this.defaultRequest(fCallback, 'ClearTwoFactorInfo'); this.defaultRequest(fCallback, 'ClearTwoFactorInfo');
}; };
@ -134,7 +133,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.contactsSync = function (fCallback) RemoteAppStorage.prototype.contactsSync = function (fCallback)
{ {
this.defaultRequest(fCallback, 'ContactsSync', null, Consts.Defaults.ContactsSyncAjaxTimeout); this.defaultRequest(fCallback, 'ContactsSync', null, Consts.Defaults.ContactsSyncAjaxTimeout);
}; };
@ -146,7 +145,7 @@
* @param {string} sUser * @param {string} sUser
* @param {string} sPassword * @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', { this.defaultRequest(fCallback, 'SaveContactsSyncData', {
'Enable': bEnable ? '1' : '0', 'Enable': bEnable ? '1' : '0',
@ -162,7 +161,7 @@
* @param {string} sLogin * @param {string} sLogin
* @param {string} sPassword * @param {string} sPassword
*/ */
RemoteStorage.prototype.accountAdd = function (fCallback, sEmail, sLogin, sPassword) RemoteAppStorage.prototype.accountAdd = function (fCallback, sEmail, sLogin, sPassword)
{ {
this.defaultRequest(fCallback, 'AccountAdd', { this.defaultRequest(fCallback, 'AccountAdd', {
'Email': sEmail, 'Email': sEmail,
@ -175,7 +174,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {string} sEmailToDelete * @param {string} sEmailToDelete
*/ */
RemoteStorage.prototype.accountDelete = function (fCallback, sEmailToDelete) RemoteAppStorage.prototype.accountDelete = function (fCallback, sEmailToDelete)
{ {
this.defaultRequest(fCallback, 'AccountDelete', { this.defaultRequest(fCallback, 'AccountDelete', {
'EmailToDelete': sEmailToDelete 'EmailToDelete': sEmailToDelete
@ -190,7 +189,7 @@
* @param {string} sReplyTo * @param {string} sReplyTo
* @param {string} sBcc * @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', { this.defaultRequest(fCallback, 'IdentityUpdate', {
'Id': sId, 'Id': sId,
@ -205,7 +204,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {string} sIdToDelete * @param {string} sIdToDelete
*/ */
RemoteStorage.prototype.identityDelete = function (fCallback, sIdToDelete) RemoteAppStorage.prototype.identityDelete = function (fCallback, sIdToDelete)
{ {
this.defaultRequest(fCallback, 'IdentityDelete', { this.defaultRequest(fCallback, 'IdentityDelete', {
'IdToDelete': sIdToDelete 'IdToDelete': sIdToDelete
@ -215,7 +214,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.accountsAndIdentities = function (fCallback) RemoteAppStorage.prototype.accountsAndIdentities = function (fCallback)
{ {
this.defaultRequest(fCallback, 'AccountsAndIdentities'); this.defaultRequest(fCallback, 'AccountsAndIdentities');
}; };
@ -228,7 +227,7 @@
* @param {string=} sSearch = '' * @param {string=} sSearch = ''
* @param {boolean=} bSilent = false * @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); sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw);
@ -275,7 +274,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {Array} aDownloads * @param {Array} aDownloads
*/ */
RemoteStorage.prototype.messageUploadAttachments = function (fCallback, aDownloads) RemoteAppStorage.prototype.messageUploadAttachments = function (fCallback, aDownloads)
{ {
this.defaultRequest(fCallback, 'MessageUploadAttachments', { this.defaultRequest(fCallback, 'MessageUploadAttachments', {
'Attachments': aDownloads 'Attachments': aDownloads
@ -288,7 +287,7 @@
* @param {number} iUid * @param {number} iUid
* @return {boolean} * @return {boolean}
*/ */
RemoteStorage.prototype.message = function (fCallback, sFolderFullNameRaw, iUid) RemoteAppStorage.prototype.message = function (fCallback, sFolderFullNameRaw, iUid)
{ {
sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw); sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw);
iUid = Utils.pInt(iUid); iUid = Utils.pInt(iUid);
@ -313,7 +312,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {Array} aExternals * @param {Array} aExternals
*/ */
RemoteStorage.prototype.composeUploadExternals = function (fCallback, aExternals) RemoteAppStorage.prototype.composeUploadExternals = function (fCallback, aExternals)
{ {
this.defaultRequest(fCallback, 'ComposeUploadExternals', { this.defaultRequest(fCallback, 'ComposeUploadExternals', {
'Externals': aExternals 'Externals': aExternals
@ -325,7 +324,7 @@
* @param {string} sUrl * @param {string} sUrl
* @param {string} sAccessToken * @param {string} sAccessToken
*/ */
RemoteStorage.prototype.composeUploadDrive = function (fCallback, sUrl, sAccessToken) RemoteAppStorage.prototype.composeUploadDrive = function (fCallback, sUrl, sAccessToken)
{ {
this.defaultRequest(fCallback, 'ComposeUploadDrive', { this.defaultRequest(fCallback, 'ComposeUploadDrive', {
'AccessToken': sAccessToken, 'AccessToken': sAccessToken,
@ -338,7 +337,7 @@
* @param {string} sFolder * @param {string} sFolder
* @param {Array=} aList = [] * @param {Array=} aList = []
*/ */
RemoteStorage.prototype.folderInformation = function (fCallback, sFolder, aList) RemoteAppStorage.prototype.folderInformation = function (fCallback, sFolder, aList)
{ {
var var
bRequest = true, bRequest = true,
@ -381,7 +380,7 @@
} }
else if (Data.useThreads()) else if (Data.useThreads())
{ {
require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache(); require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
} }
}; };
@ -389,7 +388,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {Array} aFolders * @param {Array} aFolders
*/ */
RemoteStorage.prototype.folderInformationMultiply = function (fCallback, aFolders) RemoteAppStorage.prototype.folderInformationMultiply = function (fCallback, aFolders)
{ {
this.defaultRequest(fCallback, 'FolderInformationMultiply', { this.defaultRequest(fCallback, 'FolderInformationMultiply', {
'Folders': aFolders 'Folders': aFolders
@ -399,7 +398,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.logout = function (fCallback) RemoteAppStorage.prototype.logout = function (fCallback)
{ {
this.defaultRequest(fCallback, 'Logout'); this.defaultRequest(fCallback, 'Logout');
}; };
@ -410,7 +409,7 @@
* @param {Array} aUids * @param {Array} aUids
* @param {boolean} bSetFlagged * @param {boolean} bSetFlagged
*/ */
RemoteStorage.prototype.messageSetFlagged = function (fCallback, sFolderFullNameRaw, aUids, bSetFlagged) RemoteAppStorage.prototype.messageSetFlagged = function (fCallback, sFolderFullNameRaw, aUids, bSetFlagged)
{ {
this.defaultRequest(fCallback, 'MessageSetFlagged', { this.defaultRequest(fCallback, 'MessageSetFlagged', {
'Folder': sFolderFullNameRaw, 'Folder': sFolderFullNameRaw,
@ -425,7 +424,7 @@
* @param {Array} aUids * @param {Array} aUids
* @param {boolean} bSetSeen * @param {boolean} bSetSeen
*/ */
RemoteStorage.prototype.messageSetSeen = function (fCallback, sFolderFullNameRaw, aUids, bSetSeen) RemoteAppStorage.prototype.messageSetSeen = function (fCallback, sFolderFullNameRaw, aUids, bSetSeen)
{ {
this.defaultRequest(fCallback, 'MessageSetSeen', { this.defaultRequest(fCallback, 'MessageSetSeen', {
'Folder': sFolderFullNameRaw, 'Folder': sFolderFullNameRaw,
@ -439,7 +438,7 @@
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
* @param {boolean} bSetSeen * @param {boolean} bSetSeen
*/ */
RemoteStorage.prototype.messageSetSeenToAll = function (fCallback, sFolderFullNameRaw, bSetSeen) RemoteAppStorage.prototype.messageSetSeenToAll = function (fCallback, sFolderFullNameRaw, bSetSeen)
{ {
this.defaultRequest(fCallback, 'MessageSetSeenToAll', { this.defaultRequest(fCallback, 'MessageSetSeenToAll', {
'Folder': sFolderFullNameRaw, 'Folder': sFolderFullNameRaw,
@ -464,7 +463,7 @@
* @param {string} sInReplyTo * @param {string} sInReplyTo
* @param {string} sReferences * @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) sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences)
{ {
this.defaultRequest(fCallback, 'SaveMessage', { this.defaultRequest(fCallback, 'SaveMessage', {
@ -494,7 +493,7 @@
* @param {string} sSubject * @param {string} sSubject
* @param {string} sText * @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', { this.defaultRequest(fCallback, 'SendReadReceiptMessage', {
'MessageFolder': sMessageFolder, 'MessageFolder': sMessageFolder,
@ -523,7 +522,7 @@
* @param {string} sReferences * @param {string} sReferences
* @param {boolean} bRequestReadReceipt * @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) sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences, bRequestReadReceipt)
{ {
this.defaultRequest(fCallback, 'SendMessage', { this.defaultRequest(fCallback, 'SendMessage', {
@ -549,7 +548,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {Object} oData * @param {Object} oData
*/ */
RemoteStorage.prototype.saveSystemFolders = function (fCallback, oData) RemoteAppStorage.prototype.saveSystemFolders = function (fCallback, oData)
{ {
this.defaultRequest(fCallback, 'SystemFoldersUpdate', oData); this.defaultRequest(fCallback, 'SystemFoldersUpdate', oData);
}; };
@ -558,7 +557,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {Object} oData * @param {Object} oData
*/ */
RemoteStorage.prototype.saveSettings = function (fCallback, oData) RemoteAppStorage.prototype.saveSettings = function (fCallback, oData)
{ {
this.defaultRequest(fCallback, 'SettingsUpdate', oData); this.defaultRequest(fCallback, 'SettingsUpdate', oData);
}; };
@ -568,7 +567,7 @@
* @param {string} sPrevPassword * @param {string} sPrevPassword
* @param {string} sNewPassword * @param {string} sNewPassword
*/ */
RemoteStorage.prototype.changePassword = function (fCallback, sPrevPassword, sNewPassword) RemoteAppStorage.prototype.changePassword = function (fCallback, sPrevPassword, sNewPassword)
{ {
this.defaultRequest(fCallback, 'ChangePassword', { this.defaultRequest(fCallback, 'ChangePassword', {
'PrevPassword': sPrevPassword, 'PrevPassword': sPrevPassword,
@ -581,7 +580,7 @@
* @param {string} sNewFolderName * @param {string} sNewFolderName
* @param {string} sParentName * @param {string} sParentName
*/ */
RemoteStorage.prototype.folderCreate = function (fCallback, sNewFolderName, sParentName) RemoteAppStorage.prototype.folderCreate = function (fCallback, sNewFolderName, sParentName)
{ {
this.defaultRequest(fCallback, 'FolderCreate', { this.defaultRequest(fCallback, 'FolderCreate', {
'Folder': sNewFolderName, 'Folder': sNewFolderName,
@ -593,7 +592,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
*/ */
RemoteStorage.prototype.folderDelete = function (fCallback, sFolderFullNameRaw) RemoteAppStorage.prototype.folderDelete = function (fCallback, sFolderFullNameRaw)
{ {
this.defaultRequest(fCallback, 'FolderDelete', { this.defaultRequest(fCallback, 'FolderDelete', {
'Folder': sFolderFullNameRaw 'Folder': sFolderFullNameRaw
@ -605,7 +604,7 @@
* @param {string} sPrevFolderFullNameRaw * @param {string} sPrevFolderFullNameRaw
* @param {string} sNewFolderName * @param {string} sNewFolderName
*/ */
RemoteStorage.prototype.folderRename = function (fCallback, sPrevFolderFullNameRaw, sNewFolderName) RemoteAppStorage.prototype.folderRename = function (fCallback, sPrevFolderFullNameRaw, sNewFolderName)
{ {
this.defaultRequest(fCallback, 'FolderRename', { this.defaultRequest(fCallback, 'FolderRename', {
'Folder': sPrevFolderFullNameRaw, 'Folder': sPrevFolderFullNameRaw,
@ -617,7 +616,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
*/ */
RemoteStorage.prototype.folderClear = function (fCallback, sFolderFullNameRaw) RemoteAppStorage.prototype.folderClear = function (fCallback, sFolderFullNameRaw)
{ {
this.defaultRequest(fCallback, 'FolderClear', { this.defaultRequest(fCallback, 'FolderClear', {
'Folder': sFolderFullNameRaw 'Folder': sFolderFullNameRaw
@ -629,7 +628,7 @@
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
* @param {boolean} bSubscribe * @param {boolean} bSubscribe
*/ */
RemoteStorage.prototype.folderSetSubscribe = function (fCallback, sFolderFullNameRaw, bSubscribe) RemoteAppStorage.prototype.folderSetSubscribe = function (fCallback, sFolderFullNameRaw, bSubscribe)
{ {
this.defaultRequest(fCallback, 'FolderSubscribe', { this.defaultRequest(fCallback, 'FolderSubscribe', {
'Folder': sFolderFullNameRaw, 'Folder': sFolderFullNameRaw,
@ -644,7 +643,7 @@
* @param {Array} aUids * @param {Array} aUids
* @param {string=} sLearning * @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', { this.defaultRequest(fCallback, 'MessageMove', {
'FromFolder': sFolder, 'FromFolder': sFolder,
@ -660,7 +659,7 @@
* @param {string} sToFolder * @param {string} sToFolder
* @param {Array} aUids * @param {Array} aUids
*/ */
RemoteStorage.prototype.messagesCopy = function (fCallback, sFolder, sToFolder, aUids) RemoteAppStorage.prototype.messagesCopy = function (fCallback, sFolder, sToFolder, aUids)
{ {
this.defaultRequest(fCallback, 'MessageCopy', { this.defaultRequest(fCallback, 'MessageCopy', {
'FromFolder': sFolder, 'FromFolder': sFolder,
@ -674,7 +673,7 @@
* @param {string} sFolder * @param {string} sFolder
* @param {Array} aUids * @param {Array} aUids
*/ */
RemoteStorage.prototype.messagesDelete = function (fCallback, sFolder, aUids) RemoteAppStorage.prototype.messagesDelete = function (fCallback, sFolder, aUids)
{ {
this.defaultRequest(fCallback, 'MessageDelete', { this.defaultRequest(fCallback, 'MessageDelete', {
'Folder': sFolder, 'Folder': sFolder,
@ -685,7 +684,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.appDelayStart = function (fCallback) RemoteAppStorage.prototype.appDelayStart = function (fCallback)
{ {
this.defaultRequest(fCallback, 'AppDelayStart'); this.defaultRequest(fCallback, 'AppDelayStart');
}; };
@ -693,7 +692,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.quota = function (fCallback) RemoteAppStorage.prototype.quota = function (fCallback)
{ {
this.defaultRequest(fCallback, 'Quota'); this.defaultRequest(fCallback, 'Quota');
}; };
@ -704,7 +703,7 @@
* @param {number} iLimit * @param {number} iLimit
* @param {string} sSearch * @param {string} sSearch
*/ */
RemoteStorage.prototype.contacts = function (fCallback, iOffset, iLimit, sSearch) RemoteAppStorage.prototype.contacts = function (fCallback, iOffset, iLimit, sSearch)
{ {
this.defaultRequest(fCallback, 'Contacts', { this.defaultRequest(fCallback, 'Contacts', {
'Offset': iOffset, 'Offset': iOffset,
@ -716,7 +715,7 @@
/** /**
* @param {?Function} fCallback * @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', { this.defaultRequest(fCallback, 'ContactSave', {
'RequestUid': sRequestUid, 'RequestUid': sRequestUid,
@ -730,7 +729,7 @@
* @param {?Function} fCallback * @param {?Function} fCallback
* @param {Array} aUids * @param {Array} aUids
*/ */
RemoteStorage.prototype.contactsDelete = function (fCallback, aUids) RemoteAppStorage.prototype.contactsDelete = function (fCallback, aUids)
{ {
this.defaultRequest(fCallback, 'ContactsDelete', { this.defaultRequest(fCallback, 'ContactsDelete', {
'Uids': aUids.join(',') 'Uids': aUids.join(',')
@ -742,7 +741,7 @@
* @param {string} sQuery * @param {string} sQuery
* @param {number} iPage * @param {number} iPage
*/ */
RemoteStorage.prototype.suggestions = function (fCallback, sQuery, iPage) RemoteAppStorage.prototype.suggestions = function (fCallback, sQuery, iPage)
{ {
this.defaultRequest(fCallback, 'Suggestions', { this.defaultRequest(fCallback, 'Suggestions', {
'Query': sQuery, 'Query': sQuery,
@ -753,7 +752,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.facebookUser = function (fCallback) RemoteAppStorage.prototype.facebookUser = function (fCallback)
{ {
this.defaultRequest(fCallback, 'SocialFacebookUserInformation'); this.defaultRequest(fCallback, 'SocialFacebookUserInformation');
}; };
@ -761,7 +760,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.facebookDisconnect = function (fCallback) RemoteAppStorage.prototype.facebookDisconnect = function (fCallback)
{ {
this.defaultRequest(fCallback, 'SocialFacebookDisconnect'); this.defaultRequest(fCallback, 'SocialFacebookDisconnect');
}; };
@ -769,7 +768,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.twitterUser = function (fCallback) RemoteAppStorage.prototype.twitterUser = function (fCallback)
{ {
this.defaultRequest(fCallback, 'SocialTwitterUserInformation'); this.defaultRequest(fCallback, 'SocialTwitterUserInformation');
}; };
@ -777,7 +776,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.twitterDisconnect = function (fCallback) RemoteAppStorage.prototype.twitterDisconnect = function (fCallback)
{ {
this.defaultRequest(fCallback, 'SocialTwitterDisconnect'); this.defaultRequest(fCallback, 'SocialTwitterDisconnect');
}; };
@ -785,7 +784,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.googleUser = function (fCallback) RemoteAppStorage.prototype.googleUser = function (fCallback)
{ {
this.defaultRequest(fCallback, 'SocialGoogleUserInformation'); this.defaultRequest(fCallback, 'SocialGoogleUserInformation');
}; };
@ -793,7 +792,7 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.googleDisconnect = function (fCallback) RemoteAppStorage.prototype.googleDisconnect = function (fCallback)
{ {
this.defaultRequest(fCallback, 'SocialGoogleDisconnect'); this.defaultRequest(fCallback, 'SocialGoogleDisconnect');
}; };
@ -801,11 +800,11 @@
/** /**
* @param {?Function} fCallback * @param {?Function} fCallback
*/ */
RemoteStorage.prototype.socialUsers = function (fCallback) RemoteAppStorage.prototype.socialUsers = function (fCallback)
{ {
this.defaultRequest(fCallback, 'SocialUsers'); this.defaultRequest(fCallback, 'SocialUsers');
}; };
module.exports = new RemoteStorage(); module.exports = new RemoteAppStorage();
}()); }());

View file

@ -11,8 +11,8 @@
{ {
var var
NextStorageDriver = require('_').find([ NextStorageDriver = require('_').find([
require('Storage:LocalStorage:LocalStorage'), require('Storage/LocalDriver/LocalStorage'),
require('Storage:LocalStorage:Cookie') require('Storage/LocalDriver/Cookie')
], function (NextStorageDriver) { ], function (NextStorageDriver) {
return NextStorageDriver && NextStorageDriver.supported(); return NextStorageDriver && NextStorageDriver.supported();
}) })

View file

@ -15,7 +15,7 @@
/** /**
* @constructor * @constructor
*/ */
function CookieDriver() function CookieLocalDriver()
{ {
} }
@ -23,7 +23,7 @@
* @static * @static
* @return {boolean} * @return {boolean}
*/ */
CookieDriver.supported = function () CookieLocalDriver.supported = function ()
{ {
return !!(window.navigator && window.navigator.cookieEnabled); return !!(window.navigator && window.navigator.cookieEnabled);
}; };
@ -33,7 +33,7 @@
* @param {*} mData * @param {*} mData
* @return {boolean} * @return {boolean}
*/ */
CookieDriver.prototype.set = function (sKey, mData) CookieLocalDriver.prototype.set = function (sKey, mData)
{ {
var var
mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName), mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName),
@ -71,7 +71,7 @@
* @param {string} sKey * @param {string} sKey
* @return {*} * @return {*}
*/ */
CookieDriver.prototype.get = function (sKey) CookieLocalDriver.prototype.get = function (sKey)
{ {
var var
mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName), mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName),
@ -95,6 +95,6 @@
return mResult; return mResult;
}; };
module.exports = CookieDriver; module.exports = CookieLocalDriver;
}()); }());

View file

@ -15,7 +15,7 @@
/** /**
* @constructor * @constructor
*/ */
function LocalStorageDriver() function LocalStorageLocalDriver()
{ {
} }
@ -23,7 +23,7 @@
* @static * @static
* @return {boolean} * @return {boolean}
*/ */
LocalStorageDriver.supported = function () LocalStorageLocalDriver.supported = function ()
{ {
return !!window.localStorage; return !!window.localStorage;
}; };
@ -33,7 +33,7 @@
* @param {*} mData * @param {*} mData
* @return {boolean} * @return {boolean}
*/ */
LocalStorageDriver.prototype.set = function (sKey, mData) LocalStorageLocalDriver.prototype.set = function (sKey, mData)
{ {
var var
mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null, mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null,
@ -69,7 +69,7 @@
* @param {string} sKey * @param {string} sKey
* @return {*} * @return {*}
*/ */
LocalStorageDriver.prototype.get = function (sKey) LocalStorageLocalDriver.prototype.get = function (sKey)
{ {
var var
mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null, mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null,
@ -93,6 +93,6 @@
return mResult; return mResult;
}; };
module.exports = LocalStorageDriver; module.exports = LocalStorageLocalDriver;
}()); }());

View file

@ -10,19 +10,19 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Remote = require('Storage:Admin:Remote'), Remote = require('Storage/Admin/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function AdminLoginViewModel() function LoginAdminView()
{ {
KnoinAbstractViewModel.call(this, 'Center', 'AdminLogin'); AbstractView.call(this, 'Center', 'AdminLogin');
this.login = ko.observable(''); this.login = ko.observable('');
this.password = ko.observable(''); this.password = ko.observable('');
@ -63,7 +63,7 @@
{ {
if (oData.Result) if (oData.Result)
{ {
require('App:Admin').loginAndLogoutReload(); require('App/Admin').loginAndLogoutReload();
} }
else if (oData.ErrorCode) else if (oData.ErrorCode)
{ {
@ -88,10 +88,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Admin:Login', 'AdminLoginViewModel'], AdminLoginViewModel); kn.extendAsViewModel(['View/Admin/Login', 'AdminLoginViewModel'], LoginAdminView);
_.extend(AdminLoginViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(LoginAdminView.prototype, AbstractView.prototype);
AdminLoginViewModel.prototype.onShow = function () LoginAdminView.prototype.onShow = function ()
{ {
kn.routeOff(); kn.routeOff();
@ -101,21 +101,21 @@
}; };
AdminLoginViewModel.prototype.onHide = function () LoginAdminView.prototype.onHide = function ()
{ {
this.loginFocus(false); this.loginFocus(false);
}; };
AdminLoginViewModel.prototype.onBuild = function () LoginAdminView.prototype.onBuild = function ()
{ {
Utils.triggerAutocompleteInputChange(true); Utils.triggerAutocompleteInputChange(true);
}; };
AdminLoginViewModel.prototype.submitForm = function () LoginAdminView.prototype.submitForm = function ()
{ {
this.submitCommand(); this.submitCommand();
}; };
module.exports = AdminLoginViewModel; module.exports = LoginAdminView;
}()); }());

View file

@ -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;
}());

View file

@ -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;
}());

34
dev/View/App/About.js Normal file
View file

@ -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;
}());

View file

@ -13,20 +13,20 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function AbstractSystemDropDownViewModel() function AbstractSystemDropDownAppView()
{ {
KnoinAbstractViewModel.call(this, 'Right', 'SystemDropDown'); AbstractView.call(this, 'Right', 'SystemDropDown');
this.accounts = Data.accounts; this.accounts = Data.accounts;
this.accountEmail = Data.accountEmail; this.accountEmail = Data.accountEmail;
@ -43,9 +43,9 @@
this.accountClick = _.bind(this.accountClick, this); 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) if (oAccount && oEvent && !Utils.isUnd(oEvent.which) && 1 === oEvent.which)
{ {
@ -59,30 +59,30 @@
return true; return true;
}; };
AbstractSystemDropDownViewModel.prototype.emailTitle = function () AbstractSystemDropDownAppView.prototype.emailTitle = function ()
{ {
return Data.accountEmail(); 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) 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 () { Remote.logout(function () {
if (window.__rlah_clear) if (window.__rlah_clear)
@ -90,12 +90,12 @@
window.__rlah_clear(); window.__rlah_clear();
} }
require('App:RainLoop').loginAndLogoutReload(true, require('App/App').loginAndLogoutReload(true,
Settings.settingsGet('ParentEmail') && 0 < Settings.settingsGet('ParentEmail').length); Settings.settingsGet('ParentEmail') && 0 < Settings.settingsGet('ParentEmail').length);
}); });
}; };
AbstractSystemDropDownViewModel.prototype.onBuild = function () AbstractSystemDropDownAppView.prototype.onBuild = function ()
{ {
var self = this; var self = this;
key('`', [Enums.KeyState.MessageList, Enums.KeyState.MessageView, Enums.KeyState.Settings], function () { 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 () { key('shift+/', [Enums.KeyState.MessageList, Enums.KeyState.MessageView, Enums.KeyState.Settings], function () {
if (self.viewModelVisibility()) if (self.viewModelVisibility())
{ {
require('App:Knoin').showScreenPopup(require('View:Popup:KeyboardShortcutsHelp')); require('Knoin/Knoin').showScreenPopup(require('View/Popup/KeyboardShortcutsHelp'));
return false; return false;
} }
}); });
}; };
module.exports = AbstractSystemDropDownViewModel; module.exports = AbstractSystemDropDownAppView;
}()); }());

View file

@ -13,21 +13,21 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function LoginViewModel() function LoginAppView()
{ {
KnoinAbstractViewModel.call(this, 'Center', 'Login'); AbstractView.call(this, 'Center', 'Login');
this.email = ko.observable(''); this.email = ko.observable('');
this.password = ko.observable(''); this.password = ko.observable('');
@ -130,7 +130,7 @@
} }
else else
{ {
require('App:RainLoop').loginAndLogoutReload(); require('App/App').loginAndLogoutReload();
} }
} }
else if (oData.ErrorCode) else if (oData.ErrorCode)
@ -249,10 +249,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:RainLoop:Login', 'LoginViewModel'], LoginViewModel); kn.extendAsViewModel(['View/App/Login', 'LoginViewModel'], LoginAppView);
_.extend(LoginViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(LoginAppView.prototype, AbstractView.prototype);
LoginViewModel.prototype.onShow = function () LoginAppView.prototype.onShow = function ()
{ {
kn.routeOff(); kn.routeOff();
@ -274,13 +274,13 @@
}, this), 100); }, this), 100);
}; };
LoginViewModel.prototype.onHide = function () LoginAppView.prototype.onHide = function ()
{ {
this.submitFocus(false); this.submitFocus(false);
this.emailFocus(false); this.emailFocus(false);
}; };
LoginViewModel.prototype.onBuild = function () LoginAppView.prototype.onBuild = function ()
{ {
var var
self = this, self = this,
@ -290,7 +290,7 @@
if (0 === iErrorCode) if (0 === iErrorCode)
{ {
self.submitRequest(true); self.submitRequest(true);
require('App:RainLoop').loginAndLogoutReload(); require('App/App').loginAndLogoutReload();
} }
else else
{ {
@ -337,32 +337,32 @@
_.delay(function () { _.delay(function () {
Data.language.subscribe(function (sValue) { Data.language.subscribe(function (sValue) {
self.langRequest(true); self.langRequest(true);
Utils.reloadLanguage(sValue, function() { Utils.reloadLanguage(sValue, function() {
self.bSendLanguage = true; self.bSendLanguage = true;
$.cookie('rllang', sValue, {'expires': 30}); $.cookie('rllang', sValue, {'expires': 30});
}, null, function() { }, null, function() {
self.langRequest(false); self.langRequest(false);
}); });
}); });
}, 50); }, 50);
Utils.triggerAutocompleteInputChange(true); Utils.triggerAutocompleteInputChange(true);
}; };
LoginViewModel.prototype.submitForm = function () LoginAppView.prototype.submitForm = function ()
{ {
this.submitCommand(); 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;
}()); }());

View file

@ -15,21 +15,21 @@
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Cache = require('Storage:RainLoop:Cache'), Cache = require('Storage/App/Cache'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function MailBoxFolderListViewModel() function FolderListMailBoxAppView()
{ {
KnoinAbstractViewModel.call(this, 'Left', 'MailFolderList'); AbstractView.call(this, 'Left', 'MailFolderList');
this.oContentVisible = null; this.oContentVisible = null;
this.oContentScrollable = null; this.oContentScrollable = null;
@ -48,10 +48,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:RainLoop:MailBoxFolderList', 'MailBoxFolderListViewModel'], MailBoxFolderListViewModel); kn.extendAsViewModel(['View/App/MailBox/FolderList', 'MailBoxFolderListViewModel'], FolderListMailBoxAppView);
_.extend(MailBoxFolderListViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(FolderListMailBoxAppView.prototype, AbstractView.prototype);
MailBoxFolderListViewModel.prototype.onBuild = function (oDom) FolderListMailBoxAppView.prototype.onBuild = function (oDom)
{ {
this.oContentVisible = $('.b-content', oDom); this.oContentVisible = $('.b-content', oDom);
this.oContentScrollable = $('.content', this.oContentVisible); this.oContentScrollable = $('.content', this.oContentVisible);
@ -69,7 +69,7 @@
if (oFolder && oEvent) if (oFolder && oEvent)
{ {
bCollapsed = oFolder.collapsed(); bCollapsed = oFolder.collapsed();
require('App:RainLoop').setExpandedFolder(oFolder.fullNameHash, bCollapsed); require('App/App').setExpandedFolder(oFolder.fullNameHash, bCollapsed);
oFolder.collapsed(!bCollapsed); oFolder.collapsed(!bCollapsed);
oEvent.preventDefault(); oEvent.preventDefault();
@ -152,7 +152,7 @@
if (oFolder) if (oFolder)
{ {
bCollapsed = oFolder.collapsed(); bCollapsed = oFolder.collapsed();
require('App:RainLoop').setExpandedFolder(oFolder.fullNameHash, bCollapsed); require('App/App').setExpandedFolder(oFolder.fullNameHash, bCollapsed);
oFolder.collapsed(!bCollapsed); oFolder.collapsed(!bCollapsed);
} }
} }
@ -174,25 +174,25 @@
}); });
}; };
MailBoxFolderListViewModel.prototype.messagesDropOver = function (oFolder) FolderListMailBoxAppView.prototype.messagesDropOver = function (oFolder)
{ {
window.clearTimeout(this.iDropOverTimer); window.clearTimeout(this.iDropOverTimer);
if (oFolder && oFolder.collapsed()) if (oFolder && oFolder.collapsed())
{ {
this.iDropOverTimer = window.setTimeout(function () { this.iDropOverTimer = window.setTimeout(function () {
oFolder.collapsed(false); oFolder.collapsed(false);
require('App:RainLoop').setExpandedFolder(oFolder.fullNameHash, true); require('App/App').setExpandedFolder(oFolder.fullNameHash, true);
Utils.windowResize(); Utils.windowResize();
}, 500); }, 500);
} }
}; };
MailBoxFolderListViewModel.prototype.messagesDropOut = function () FolderListMailBoxAppView.prototype.messagesDropOut = function ()
{ {
window.clearTimeout(this.iDropOverTimer); window.clearTimeout(this.iDropOverTimer);
}; };
MailBoxFolderListViewModel.prototype.scrollToFocused = function () FolderListMailBoxAppView.prototype.scrollToFocused = function ()
{ {
if (!this.oContentVisible || !this.oContentScrollable) if (!this.oContentVisible || !this.oContentScrollable)
{ {
@ -229,7 +229,7 @@
* @param {FolderModel} oToFolder * @param {FolderModel} oToFolder
* @param {{helper:jQuery}} oUi * @param {{helper:jQuery}} oUi
*/ */
MailBoxFolderListViewModel.prototype.messagesDrop = function (oToFolder, oUi) FolderListMailBoxAppView.prototype.messagesDrop = function (oToFolder, oUi)
{ {
if (oToFolder && oUi && oUi.helper) if (oToFolder && oUi && oUi.helper)
{ {
@ -241,34 +241,34 @@
if (Utils.isNormal(sFromFolderFullNameRaw) && '' !== sFromFolderFullNameRaw && Utils.isArray(aUids)) 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')); kn.setHash(LinkBuilder.settings('folders'));
}; };
MailBoxFolderListViewModel.prototype.contactsClick = function () FolderListMailBoxAppView.prototype.contactsClick = function ()
{ {
if (this.allowContacts) if (this.allowContacts)
{ {
kn.showScreenPopup(require('View:Popup:Contacts')); kn.showScreenPopup(require('View/Popup/Contacts'));
} }
}; };
module.exports = MailBoxFolderListViewModel; module.exports = FolderListMailBoxAppView;
}()); }());

View file

@ -19,22 +19,22 @@
Events = require('Common/Events'), Events = require('Common/Events'),
Selector = require('Common/Selector'), Selector = require('Common/Selector'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Cache = require('Storage:RainLoop:Cache'), Cache = require('Storage/App/Cache'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function MailBoxMessageListViewModel() function MessageListMailBoxAppView()
{ {
KnoinAbstractViewModel.call(this, 'Right', 'MailMessageList'); AbstractView.call(this, 'Right', 'MailMessageList');
this.sLastUid = null; this.sLastUid = null;
this.bPrefetch = false; this.bPrefetch = false;
@ -168,40 +168,40 @@
this.canBeMoved = this.hasCheckedOrSelectedLines; this.canBeMoved = this.hasCheckedOrSelectedLines;
this.clearCommand = Utils.createCommand(this, function () { 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 () { this.multyForwardCommand = Utils.createCommand(this, function () {
kn.showScreenPopup(require('View:Popup:Compose'), [ kn.showScreenPopup(require('View/Popup/Compose'), [
Enums.ComposeType.ForwardAsAttachment, Data.messageListCheckedOrSelected()]); Enums.ComposeType.ForwardAsAttachment, Data.messageListCheckedOrSelected()]);
}, this.canBeMoved); }, this.canBeMoved);
this.deleteWithoutMoveCommand = Utils.createCommand(this, function () { this.deleteWithoutMoveCommand = Utils.createCommand(this, function () {
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash, require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
Data.currentFolderFullNameRaw(), Data.currentFolderFullNameRaw(),
Data.messageListCheckedOrSelectedUidsWithSubMails(), false); Data.messageListCheckedOrSelectedUidsWithSubMails(), false);
}, this.canBeMoved); }, this.canBeMoved);
this.deleteCommand = Utils.createCommand(this, function () { this.deleteCommand = Utils.createCommand(this, function () {
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash, require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
Data.currentFolderFullNameRaw(), Data.currentFolderFullNameRaw(),
Data.messageListCheckedOrSelectedUidsWithSubMails(), true); Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
}, this.canBeMoved); }, this.canBeMoved);
this.archiveCommand = Utils.createCommand(this, function () { this.archiveCommand = Utils.createCommand(this, function () {
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Archive, require('App/App').deleteMessagesFromFolder(Enums.FolderType.Archive,
Data.currentFolderFullNameRaw(), Data.currentFolderFullNameRaw(),
Data.messageListCheckedOrSelectedUidsWithSubMails(), true); Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
}, this.canBeMoved); }, this.canBeMoved);
this.spamCommand = Utils.createCommand(this, function () { this.spamCommand = Utils.createCommand(this, function () {
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Spam, require('App/App').deleteMessagesFromFolder(Enums.FolderType.Spam,
Data.currentFolderFullNameRaw(), Data.currentFolderFullNameRaw(),
Data.messageListCheckedOrSelectedUidsWithSubMails(), true); Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
}, this.canBeMoved); }, this.canBeMoved);
this.notSpamCommand = Utils.createCommand(this, function () { this.notSpamCommand = Utils.createCommand(this, function () {
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.NotSpam, require('App/App').deleteMessagesFromFolder(Enums.FolderType.NotSpam,
Data.currentFolderFullNameRaw(), Data.currentFolderFullNameRaw(),
Data.messageListCheckedOrSelectedUidsWithSubMails(), true); Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
}, this.canBeMoved); }, this.canBeMoved);
@ -211,7 +211,7 @@
this.reloadCommand = Utils.createCommand(this, function () { this.reloadCommand = Utils.createCommand(this, function () {
if (!Data.messageListCompleteLoadingThrottle()) if (!Data.messageListCompleteLoadingThrottle())
{ {
require('App:RainLoop').reloadMessageList(false, true); require('App/App').reloadMessageList(false, true);
} }
}); });
@ -265,15 +265,15 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:RainLoop:MailBoxMessageList', 'MailBoxMessageListViewModel'], MailBoxMessageListViewModel); kn.extendAsViewModel(['View/App/MailBox/MessageList', 'MailBoxMessageListViewModel'], MessageListMailBoxAppView);
_.extend(MailBoxMessageListViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(MessageListMailBoxAppView.prototype, AbstractView.prototype);
/** /**
* @type {string} * @type {string}
*/ */
MailBoxMessageListViewModel.prototype.emptySubjectValue = ''; MessageListMailBoxAppView.prototype.emptySubjectValue = '';
MailBoxMessageListViewModel.prototype.searchEnterAction = function () MessageListMailBoxAppView.prototype.searchEnterAction = function ()
{ {
this.mainMessageListSearch(this.sLastSearchValue); this.mainMessageListSearch(this.sLastSearchValue);
this.inputMessageListSearchFocus(false); this.inputMessageListSearchFocus(false);
@ -282,13 +282,13 @@
/** /**
* @returns {string} * @returns {string}
*/ */
MailBoxMessageListViewModel.prototype.printableMessageCountForDeletion = function () MessageListMailBoxAppView.prototype.printableMessageCountForDeletion = function ()
{ {
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length; var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
return 1 < iCnt ? ' (' + (100 > iCnt ? iCnt : '99+') + ')' : ''; return 1 < iCnt ? ' (' + (100 > iCnt ? iCnt : '99+') + ')' : '';
}; };
MailBoxMessageListViewModel.prototype.cancelSearch = function () MessageListMailBoxAppView.prototype.cancelSearch = function ()
{ {
this.mainMessageListSearch(''); this.mainMessageListSearch('');
this.inputMessageListSearchFocus(false); this.inputMessageListSearchFocus(false);
@ -299,11 +299,11 @@
* @param {boolean} bCopy * @param {boolean} bCopy
* @return {boolean} * @return {boolean}
*/ */
MailBoxMessageListViewModel.prototype.moveSelectedMessagesToFolder = function (sToFolderFullNameRaw, bCopy) MessageListMailBoxAppView.prototype.moveSelectedMessagesToFolder = function (sToFolderFullNameRaw, bCopy)
{ {
if (this.canBeMoved()) if (this.canBeMoved())
{ {
require('App:RainLoop').moveMessagesToFolder( require('App/App').moveMessagesToFolder(
Data.currentFolderFullNameRaw(), Data.currentFolderFullNameRaw(),
Data.messageListCheckedOrSelectedUidsWithSubMails(), sToFolderFullNameRaw, bCopy); Data.messageListCheckedOrSelectedUidsWithSubMails(), sToFolderFullNameRaw, bCopy);
} }
@ -311,7 +311,7 @@
return false; return false;
}; };
MailBoxMessageListViewModel.prototype.dragAndDronHelper = function (oMessageListItem) MessageListMailBoxAppView.prototype.dragAndDronHelper = function (oMessageListItem)
{ {
if (oMessageListItem) if (oMessageListItem)
{ {
@ -342,7 +342,7 @@
* @param {AjaxJsonDefaultResponse} oData * @param {AjaxJsonDefaultResponse} oData
* @param {boolean} bCached * @param {boolean} bCached
*/ */
MailBoxMessageListViewModel.prototype.onMessageResponse = function (sResult, oData, bCached) MessageListMailBoxAppView.prototype.onMessageResponse = function (sResult, oData, bCached)
{ {
Data.hideMessageBodies(); Data.hideMessageBodies();
Data.messageLoading(false); Data.messageLoading(false);
@ -365,7 +365,7 @@
} }
}; };
MailBoxMessageListViewModel.prototype.populateMessageBody = function (oMessage) MessageListMailBoxAppView.prototype.populateMessageBody = function (oMessage)
{ {
if (oMessage) if (oMessage)
{ {
@ -385,7 +385,7 @@
* @param {number} iSetAction * @param {number} iSetAction
* @param {Array=} aMessages = null * @param {Array=} aMessages = null
*/ */
MailBoxMessageListViewModel.prototype.setAction = function (sFolderFullNameRaw, iSetAction, aMessages) MessageListMailBoxAppView.prototype.setAction = function (sFolderFullNameRaw, iSetAction, aMessages)
{ {
var var
aUids = [], aUids = [],
@ -458,7 +458,7 @@
break; break;
} }
require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache(); require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
} }
}; };
@ -466,7 +466,7 @@
* @param {string} sFolderFullNameRaw * @param {string} sFolderFullNameRaw
* @param {number} iSetAction * @param {number} iSetAction
*/ */
MailBoxMessageListViewModel.prototype.setActionForAll = function (sFolderFullNameRaw, iSetAction) MessageListMailBoxAppView.prototype.setActionForAll = function (sFolderFullNameRaw, iSetAction)
{ {
var var
oFolder = null, oFolder = null,
@ -509,37 +509,37 @@
break; 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()); this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetSeen, Data.messageListCheckedOrSelected());
}; };
MailBoxMessageListViewModel.prototype.listSetAllSeen = function () MessageListMailBoxAppView.prototype.listSetAllSeen = function ()
{ {
this.setActionForAll(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetSeen); this.setActionForAll(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetSeen);
}; };
MailBoxMessageListViewModel.prototype.listUnsetSeen = function () MessageListMailBoxAppView.prototype.listUnsetSeen = function ()
{ {
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.UnsetSeen, Data.messageListCheckedOrSelected()); 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()); 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()); this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.UnsetFlag, Data.messageListCheckedOrSelected());
}; };
MailBoxMessageListViewModel.prototype.flagMessages = function (oCurrentMessage) MessageListMailBoxAppView.prototype.flagMessages = function (oCurrentMessage)
{ {
var var
aChecked = this.messageListCheckedOrSelected(), aChecked = this.messageListCheckedOrSelected(),
@ -568,7 +568,7 @@
} }
}; };
MailBoxMessageListViewModel.prototype.flagMessagesFast = function (bFlag) MessageListMailBoxAppView.prototype.flagMessagesFast = function (bFlag)
{ {
var var
aChecked = this.messageListCheckedOrSelected(), aChecked = this.messageListCheckedOrSelected(),
@ -594,7 +594,7 @@
} }
}; };
MailBoxMessageListViewModel.prototype.seenMessagesFast = function (bSeen) MessageListMailBoxAppView.prototype.seenMessagesFast = function (bSeen)
{ {
var var
aChecked = this.messageListCheckedOrSelected(), aChecked = this.messageListCheckedOrSelected(),
@ -620,7 +620,7 @@
} }
}; };
MailBoxMessageListViewModel.prototype.onBuild = function (oDom) MessageListMailBoxAppView.prototype.onBuild = function (oDom)
{ {
var self = this; var self = this;
@ -653,7 +653,7 @@
oMessage.lastInCollapsedThreadLoading(true); oMessage.lastInCollapsedThreadLoading(true);
oMessage.lastInCollapsedThread(!oMessage.lastInCollapsedThread()); oMessage.lastInCollapsedThread(!oMessage.lastInCollapsedThread());
require('App:RainLoop').reloadMessageList(); require('App/App').reloadMessageList();
} }
return false; return false;
@ -700,7 +700,7 @@
} }
}; };
MailBoxMessageListViewModel.prototype.initShortcuts = function () MessageListMailBoxAppView.prototype.initShortcuts = function ()
{ {
var self = this; var self = this;
@ -749,7 +749,7 @@
// write/compose (open compose popup) // write/compose (open compose popup)
key('w,c', [Enums.KeyState.MessageList, Enums.KeyState.MessageView], function () { key('w,c', [Enums.KeyState.MessageList, Enums.KeyState.MessageView], function () {
kn.showScreenPopup(require('View:Popup:Compose')); kn.showScreenPopup(require('View/Popup/Compose'));
return false; return false;
}); });
@ -822,7 +822,7 @@
}); });
}; };
MailBoxMessageListViewModel.prototype.prefetchNextTick = function () MessageListMailBoxAppView.prototype.prefetchNextTick = function ()
{ {
if (!this.bPrefetch && !ifvisible.now() && this.viewModelVisibility()) 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', { return Utils.i18n('MESSAGE_LIST/QUOTA_SIZE', {
'SIZE': Utils.friendlySize(this.userUsageSize()), 'SIZE': Utils.friendlySize(this.userUsageSize()),
@ -876,7 +876,7 @@
}); });
}; };
MailBoxMessageListViewModel.prototype.initUploaderForAppend = function () MessageListMailBoxAppView.prototype.initUploaderForAppend = function ()
{ {
if (!Settings.settingsGet('AllowAppendMessage') || !this.dragOverArea()) if (!Settings.settingsGet('AllowAppendMessage') || !this.dragOverArea())
{ {
@ -923,13 +923,13 @@
return false; return false;
}, this)) }, this))
.on('onComplete', _.bind(function () { .on('onComplete', _.bind(function () {
require('App:RainLoop').reloadMessageList(true, true); require('App/App').reloadMessageList(true, true);
}, this)) }, this))
; ;
return !!oJua; return !!oJua;
}; };
module.exports = MailBoxMessageListViewModel; module.exports = MessageListMailBoxAppView;
}()); }());

View file

@ -15,21 +15,21 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Events = require('Common/Events'), Events = require('Common/Events'),
Cache = require('Storage:RainLoop:Cache'), Cache = require('Storage/App/Cache'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function MailBoxMessageViewViewModel() function MessageViewMailBoxAppView()
{ {
KnoinAbstractViewModel.call(this, 'Right', 'MailMessageView'); AbstractView.call(this, 'Right', 'MailMessageView');
var var
self = this, self = this,
@ -98,7 +98,7 @@
this.deleteCommand = Utils.createCommand(this, function () { this.deleteCommand = Utils.createCommand(this, function () {
if (this.message()) if (this.message())
{ {
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash, require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
this.message().folderFullNameRaw, this.message().folderFullNameRaw,
[this.message().uid], true); [this.message().uid], true);
} }
@ -107,7 +107,7 @@
this.deleteWithoutMoveCommand = Utils.createCommand(this, function () { this.deleteWithoutMoveCommand = Utils.createCommand(this, function () {
if (this.message()) if (this.message())
{ {
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash, require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
Data.currentFolderFullNameRaw(), Data.currentFolderFullNameRaw(),
[this.message().uid], false); [this.message().uid], false);
} }
@ -116,7 +116,7 @@
this.archiveCommand = Utils.createCommand(this, function () { this.archiveCommand = Utils.createCommand(this, function () {
if (this.message()) if (this.message())
{ {
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Archive, require('App/App').deleteMessagesFromFolder(Enums.FolderType.Archive,
this.message().folderFullNameRaw, this.message().folderFullNameRaw,
[this.message().uid], true); [this.message().uid], true);
} }
@ -125,7 +125,7 @@
this.spamCommand = Utils.createCommand(this, function () { this.spamCommand = Utils.createCommand(this, function () {
if (this.message()) if (this.message())
{ {
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Spam, require('App/App').deleteMessagesFromFolder(Enums.FolderType.Spam,
this.message().folderFullNameRaw, this.message().folderFullNameRaw,
[this.message().uid], true); [this.message().uid], true);
} }
@ -134,7 +134,7 @@
this.notSpamCommand = Utils.createCommand(this, function () { this.notSpamCommand = Utils.createCommand(this, function () {
if (this.message()) if (this.message())
{ {
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.NotSpam, require('App/App').deleteMessagesFromFolder(Enums.FolderType.NotSpam,
this.message().folderFullNameRaw, this.message().folderFullNameRaw,
[this.message().uid], true); [this.message().uid], true);
} }
@ -248,25 +248,25 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:RainLoop:MailBoxMessageView', 'MailBoxMessageViewViewModel'], MailBoxMessageViewViewModel); kn.extendAsViewModel(['View/App/MailBox/MessageView', 'MailBoxMessageViewViewModel'], MessageViewMailBoxAppView);
_.extend(MailBoxMessageViewViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(MessageViewMailBoxAppView.prototype, AbstractView.prototype);
MailBoxMessageViewViewModel.prototype.isPgpActionVisible = function () MessageViewMailBoxAppView.prototype.isPgpActionVisible = function ()
{ {
return Enums.SignedVerifyStatus.Success !== this.viewPgpSignedVerifyStatus(); return Enums.SignedVerifyStatus.Success !== this.viewPgpSignedVerifyStatus();
}; };
MailBoxMessageViewViewModel.prototype.isPgpStatusVerifyVisible = function () MessageViewMailBoxAppView.prototype.isPgpStatusVerifyVisible = function ()
{ {
return Enums.SignedVerifyStatus.None !== this.viewPgpSignedVerifyStatus(); return Enums.SignedVerifyStatus.None !== this.viewPgpSignedVerifyStatus();
}; };
MailBoxMessageViewViewModel.prototype.isPgpStatusVerifySuccess = function () MessageViewMailBoxAppView.prototype.isPgpStatusVerifySuccess = function ()
{ {
return Enums.SignedVerifyStatus.Success === this.viewPgpSignedVerifyStatus(); return Enums.SignedVerifyStatus.Success === this.viewPgpSignedVerifyStatus();
}; };
MailBoxMessageViewViewModel.prototype.pgpStatusVerifyMessage = function () MessageViewMailBoxAppView.prototype.pgpStatusVerifyMessage = function ()
{ {
var sResult = ''; var sResult = '';
switch (this.viewPgpSignedVerifyStatus()) switch (this.viewPgpSignedVerifyStatus())
@ -293,19 +293,19 @@
return sResult; return sResult;
}; };
MailBoxMessageViewViewModel.prototype.fullScreen = function () MessageViewMailBoxAppView.prototype.fullScreen = function ()
{ {
this.fullScreenMode(true); this.fullScreenMode(true);
Utils.windowResize(); Utils.windowResize();
}; };
MailBoxMessageViewViewModel.prototype.unFullScreen = function () MessageViewMailBoxAppView.prototype.unFullScreen = function ()
{ {
this.fullScreenMode(false); this.fullScreenMode(false);
Utils.windowResize(); Utils.windowResize();
}; };
MailBoxMessageViewViewModel.prototype.toggleFullScreen = function () MessageViewMailBoxAppView.prototype.toggleFullScreen = function ()
{ {
Utils.removeSelection(); Utils.removeSelection();
@ -316,12 +316,12 @@
/** /**
* @param {string} sType * @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; var self = this;
this.fullScreenMode.subscribe(function (bValue) { this.fullScreenMode.subscribe(function (bValue) {
@ -354,7 +354,7 @@
oDom oDom
.on('click', 'a', function (oEvent) { .on('click', 'a', function (oEvent) {
// setup maito protocol // 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) { .on('click', '.attachmentsPlace .attachmentPreview', function (oEvent) {
if (oEvent && oEvent.stopPropagation) if (oEvent && oEvent.stopPropagation)
@ -370,7 +370,7 @@
if (oAttachment && oAttachment.download) if (oAttachment && oAttachment.download)
{ {
require('App:RainLoop').download(oAttachment.linkDownload()); require('App/App').download(oAttachment.linkDownload());
} }
}) })
; ;
@ -408,7 +408,7 @@
/** /**
* @return {boolean} * @return {boolean}
*/ */
MailBoxMessageViewViewModel.prototype.escShortcuts = function () MessageViewMailBoxAppView.prototype.escShortcuts = function ()
{ {
if (this.viewModelVisibility() && this.message()) if (this.viewModelVisibility() && this.message())
{ {
@ -429,7 +429,7 @@
} }
}; };
MailBoxMessageViewViewModel.prototype.initShortcuts = function () MessageViewMailBoxAppView.prototype.initShortcuts = function ()
{ {
var var
self = this self = this
@ -570,7 +570,7 @@
/** /**
* @return {boolean} * @return {boolean}
*/ */
MailBoxMessageViewViewModel.prototype.isDraftFolder = function () MessageViewMailBoxAppView.prototype.isDraftFolder = function ()
{ {
return Data.message() && Data.draftFolder() === Data.message().folderFullNameRaw; return Data.message() && Data.draftFolder() === Data.message().folderFullNameRaw;
}; };
@ -578,7 +578,7 @@
/** /**
* @return {boolean} * @return {boolean}
*/ */
MailBoxMessageViewViewModel.prototype.isSentFolder = function () MessageViewMailBoxAppView.prototype.isSentFolder = function ()
{ {
return Data.message() && Data.sentFolder() === Data.message().folderFullNameRaw; return Data.message() && Data.sentFolder() === Data.message().folderFullNameRaw;
}; };
@ -586,7 +586,7 @@
/** /**
* @return {boolean} * @return {boolean}
*/ */
MailBoxMessageViewViewModel.prototype.isSpamFolder = function () MessageViewMailBoxAppView.prototype.isSpamFolder = function ()
{ {
return Data.message() && Data.spamFolder() === Data.message().folderFullNameRaw; return Data.message() && Data.spamFolder() === Data.message().folderFullNameRaw;
}; };
@ -594,7 +594,7 @@
/** /**
* @return {boolean} * @return {boolean}
*/ */
MailBoxMessageViewViewModel.prototype.isSpamDisabled = function () MessageViewMailBoxAppView.prototype.isSpamDisabled = function ()
{ {
return Data.message() && Data.spamFolder() === Consts.Values.UnuseOptionValue; return Data.message() && Data.spamFolder() === Consts.Values.UnuseOptionValue;
}; };
@ -602,7 +602,7 @@
/** /**
* @return {boolean} * @return {boolean}
*/ */
MailBoxMessageViewViewModel.prototype.isArchiveFolder = function () MessageViewMailBoxAppView.prototype.isArchiveFolder = function ()
{ {
return Data.message() && Data.archiveFolder() === Data.message().folderFullNameRaw; return Data.message() && Data.archiveFolder() === Data.message().folderFullNameRaw;
}; };
@ -610,7 +610,7 @@
/** /**
* @return {boolean} * @return {boolean}
*/ */
MailBoxMessageViewViewModel.prototype.isArchiveDisabled = function () MessageViewMailBoxAppView.prototype.isArchiveDisabled = function ()
{ {
return Data.message() && Data.archiveFolder() === Consts.Values.UnuseOptionValue; return Data.message() && Data.archiveFolder() === Consts.Values.UnuseOptionValue;
}; };
@ -618,25 +618,25 @@
/** /**
* @return {boolean} * @return {boolean}
*/ */
MailBoxMessageViewViewModel.prototype.isDraftOrSentFolder = function () MessageViewMailBoxAppView.prototype.isDraftOrSentFolder = function ()
{ {
return this.isDraftFolder() || this.isSentFolder(); 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()) 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) if (this.oMessageScrollerDom)
{ {
@ -645,7 +645,7 @@
} }
}; };
MailBoxMessageViewViewModel.prototype.scrollMessageToLeft = function () MessageViewMailBoxAppView.prototype.scrollMessageToLeft = function ()
{ {
if (this.oMessageScrollerDom) if (this.oMessageScrollerDom)
{ {
@ -657,7 +657,7 @@
/** /**
* @param {MessageModel} oMessage * @param {MessageModel} oMessage
*/ */
MailBoxMessageViewViewModel.prototype.showImages = function (oMessage) MessageViewMailBoxAppView.prototype.showImages = function (oMessage)
{ {
if (oMessage && oMessage.showExternalImages) if (oMessage && oMessage.showExternalImages)
{ {
@ -668,7 +668,7 @@
/** /**
* @returns {string} * @returns {string}
*/ */
MailBoxMessageViewViewModel.prototype.printableCheckedMessageCount = function () MessageViewMailBoxAppView.prototype.printableCheckedMessageCount = function ()
{ {
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length; var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
return 0 < iCnt ? (100 > iCnt ? iCnt : '99+') : ''; return 0 < iCnt ? (100 > iCnt ? iCnt : '99+') : '';
@ -678,7 +678,7 @@
/** /**
* @param {MessageModel} oMessage * @param {MessageModel} oMessage
*/ */
MailBoxMessageViewViewModel.prototype.verifyPgpSignedClearMessage = function (oMessage) MessageViewMailBoxAppView.prototype.verifyPgpSignedClearMessage = function (oMessage)
{ {
if (oMessage) if (oMessage)
{ {
@ -689,7 +689,7 @@
/** /**
* @param {MessageModel} oMessage * @param {MessageModel} oMessage
*/ */
MailBoxMessageViewViewModel.prototype.decryptPgpEncryptedMessage = function (oMessage) MessageViewMailBoxAppView.prototype.decryptPgpEncryptedMessage = function (oMessage)
{ {
if (oMessage) if (oMessage)
{ {
@ -700,7 +700,7 @@
/** /**
* @param {MessageModel} oMessage * @param {MessageModel} oMessage
*/ */
MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage) MessageViewMailBoxAppView.prototype.readReceipt = function (oMessage)
{ {
if (oMessage && '' !== oMessage.readReceipt()) if (oMessage && '' !== oMessage.readReceipt())
{ {
@ -713,10 +713,10 @@
Cache.storeMessageFlagsToCache(oMessage); Cache.storeMessageFlagsToCache(oMessage);
require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache(); require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
} }
}; };
module.exports = MailBoxMessageViewViewModel; module.exports = MessageViewMailBoxAppView;
}()); }());

View file

@ -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;
}());

View file

@ -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;
}());

View file

@ -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;
}());

View file

@ -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;
}());

View file

@ -10,21 +10,21 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:Admin:Data'), Data = require('Storage/Admin/Data'),
Remote = require('Storage:Admin:Remote'), Remote = require('Storage/Admin/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsActivateViewModel() function ActivatePopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsActivate'); AbstractView.call(this, 'Popups', 'PopupsActivate');
var self = this; var self = this;
@ -104,10 +104,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:Activate', 'PopupsActivateViewModel'], PopupsActivateViewModel); kn.extendAsViewModel(['View/Popup/Activate', 'PopupsActivateViewModel'], ActivatePopupView);
_.extend(PopupsActivateViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(ActivatePopupView.prototype, AbstractView.prototype);
PopupsActivateViewModel.prototype.onShow = function () ActivatePopupView.prototype.onShow = function ()
{ {
this.domain(Settings.settingsGet('AdminDomain')); this.domain(Settings.settingsGet('AdminDomain'));
if (!this.activateProcess()) if (!this.activateProcess())
@ -119,7 +119,7 @@
} }
}; };
PopupsActivateViewModel.prototype.onFocus = function () ActivatePopupView.prototype.onFocus = function ()
{ {
if (!this.activateProcess()) if (!this.activateProcess())
{ {
@ -130,12 +130,12 @@
/** /**
* @returns {boolean} * @returns {boolean}
*/ */
PopupsActivateViewModel.prototype.validateSubscriptionKey = function () ActivatePopupView.prototype.validateSubscriptionKey = function ()
{ {
var sValue = this.key(); var sValue = this.key();
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue)); return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
}; };
module.exports = PopupsActivateViewModel; module.exports = ActivatePopupView;
}()); }());

View file

@ -10,19 +10,19 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsAddAccountViewModel() function AddAccountPopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddAccount'); AbstractView.call(this, 'Popups', 'PopupsAddAccount');
this.email = ko.observable(''); this.email = ko.observable('');
this.password = ko.observable(''); this.password = ko.observable('');
@ -62,7 +62,7 @@
{ {
if (oData.Result) if (oData.Result)
{ {
require('App:RainLoop').accountsAndIdentities(); require('App/App').accountsAndIdentities();
this.cancelCommand(); this.cancelCommand();
} }
else if (oData.ErrorCode) else if (oData.ErrorCode)
@ -86,10 +86,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:AddAccount', 'PopupsAddAccountViewModel'], PopupsAddAccountViewModel); kn.extendAsViewModel(['View/Popup/AddAccount', 'PopupsAddAccountViewModel'], AddAccountPopupView);
_.extend(PopupsAddAccountViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(AddAccountPopupView.prototype, AbstractView.prototype);
PopupsAddAccountViewModel.prototype.clearPopup = function () AddAccountPopupView.prototype.clearPopup = function ()
{ {
this.email(''); this.email('');
this.password(''); this.password('');
@ -101,16 +101,16 @@
this.submitError(''); this.submitError('');
}; };
PopupsAddAccountViewModel.prototype.onShow = function () AddAccountPopupView.prototype.onShow = function ()
{ {
this.clearPopup(); this.clearPopup();
}; };
PopupsAddAccountViewModel.prototype.onFocus = function () AddAccountPopupView.prototype.onFocus = function ()
{ {
this.emailFocus(true); this.emailFocus(true);
}; };
module.exports = PopupsAddAccountViewModel; module.exports = AddAccountPopupView;
}()); }());

View file

@ -9,19 +9,19 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @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 = ko.observable('');
this.key.error = ko.observable(false); this.key.error = ko.observable(false);
@ -77,7 +77,7 @@
oOpenpgpKeyring.store(); oOpenpgpKeyring.store();
require('App:RainLoop').reloadOpenPgpKeys(); require('App/App').reloadOpenPgpKeys();
Utils.delegateRun(this, 'cancelCommand'); Utils.delegateRun(this, 'cancelCommand');
return true; return true;
@ -86,25 +86,25 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:AddOpenPgpKey', 'PopupsAddOpenPgpKeyViewModel'], PopupsAddOpenPgpKeyViewModel); kn.extendAsViewModel(['View/Popup/AddOpenPgpKey', 'PopupsAddOpenPgpKeyViewModel'], AddOpenPgpKeyPopupView);
_.extend(PopupsAddOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(AddOpenPgpKeyPopupView.prototype, AbstractView.prototype);
PopupsAddOpenPgpKeyViewModel.prototype.clearPopup = function () AddOpenPgpKeyPopupView.prototype.clearPopup = function ()
{ {
this.key(''); this.key('');
this.key.error(false); this.key.error(false);
}; };
PopupsAddOpenPgpKeyViewModel.prototype.onShow = function () AddOpenPgpKeyPopupView.prototype.onShow = function ()
{ {
this.clearPopup(); this.clearPopup();
}; };
PopupsAddOpenPgpKeyViewModel.prototype.onFocus = function () AddOpenPgpKeyPopupView.prototype.onFocus = function ()
{ {
this.key.focus(true); this.key.focus(true);
}; };
module.exports = PopupsAddOpenPgpKeyViewModel; module.exports = AddOpenPgpKeyPopupView;
}()); }());

View file

@ -10,19 +10,19 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsAdvancedSearchViewModel() function AdvancedSearchPopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAdvancedSearch'); AbstractView.call(this, 'Popups', 'PopupsAdvancedSearch');
this.fromFocus = ko.observable(false); this.fromFocus = ko.observable(false);
@ -50,10 +50,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:AdvancedSearch', 'PopupsAdvancedSearchViewModel'], PopupsAdvancedSearchViewModel); kn.extendAsViewModel(['View/Popup/AdvancedSearch', 'PopupsAdvancedSearchViewModel'], AdvancedSearchPopupView);
_.extend(PopupsAdvancedSearchViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(AdvancedSearchPopupView.prototype, AbstractView.prototype);
PopupsAdvancedSearchViewModel.prototype.buildSearchStringValue = function (sValue) AdvancedSearchPopupView.prototype.buildSearchStringValue = function (sValue)
{ {
if (-1 < sValue.indexOf(' ')) if (-1 < sValue.indexOf(' '))
{ {
@ -63,7 +63,7 @@
return sValue; return sValue;
}; };
PopupsAdvancedSearchViewModel.prototype.buildSearchString = function () AdvancedSearchPopupView.prototype.buildSearchString = function ()
{ {
var var
aResult = [], aResult = [],
@ -128,7 +128,7 @@
return Utils.trim(aResult.join(' ')); return Utils.trim(aResult.join(' '));
}; };
PopupsAdvancedSearchViewModel.prototype.clearPopup = function () AdvancedSearchPopupView.prototype.clearPopup = function ()
{ {
this.from(''); this.from('');
this.to(''); this.to('');
@ -143,16 +143,16 @@
this.fromFocus(true); this.fromFocus(true);
}; };
PopupsAdvancedSearchViewModel.prototype.onShow = function () AdvancedSearchPopupView.prototype.onShow = function ()
{ {
this.clearPopup(); this.clearPopup();
}; };
PopupsAdvancedSearchViewModel.prototype.onFocus = function () AdvancedSearchPopupView.prototype.onFocus = function ()
{ {
this.fromFocus(true); this.fromFocus(true);
}; };
module.exports = PopupsAdvancedSearchViewModel; module.exports = AdvancedSearchPopupView;
}()); }());

View file

@ -11,17 +11,17 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsAskViewModel() function AskPopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAsk'); AbstractView.call(this, 'Popups', 'PopupsAsk');
this.askDesc = ko.observable(''); this.askDesc = ko.observable('');
this.yesButton = ko.observable(''); this.yesButton = ko.observable('');
@ -39,10 +39,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:Ask', 'PopupsAskViewModel'], PopupsAskViewModel); kn.extendAsViewModel(['View/Popup/Ask', 'PopupsAskViewModel'], AskPopupView);
_.extend(PopupsAskViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(AskPopupView.prototype, AbstractView.prototype);
PopupsAskViewModel.prototype.clearPopup = function () AskPopupView.prototype.clearPopup = function ()
{ {
this.askDesc(''); this.askDesc('');
this.yesButton(Utils.i18n('POPUPS_ASK/BUTTON_YES')); this.yesButton(Utils.i18n('POPUPS_ASK/BUTTON_YES'));
@ -55,7 +55,7 @@
this.fNoAction = null; this.fNoAction = null;
}; };
PopupsAskViewModel.prototype.yesClick = function () AskPopupView.prototype.yesClick = function ()
{ {
this.cancelCommand(); this.cancelCommand();
@ -65,7 +65,7 @@
} }
}; };
PopupsAskViewModel.prototype.noClick = function () AskPopupView.prototype.noClick = function ()
{ {
this.cancelCommand(); this.cancelCommand();
@ -82,7 +82,7 @@
* @param {string=} sYesButton * @param {string=} sYesButton
* @param {string=} sNoButton * @param {string=} sNoButton
*/ */
PopupsAskViewModel.prototype.onShow = function (sAskDesc, fYesFunc, fNoFunc, sYesButton, sNoButton) AskPopupView.prototype.onShow = function (sAskDesc, fYesFunc, fNoFunc, sYesButton, sNoButton)
{ {
this.clearPopup(); this.clearPopup();
@ -101,12 +101,12 @@
} }
}; };
PopupsAskViewModel.prototype.onFocus = function () AskPopupView.prototype.onFocus = function ()
{ {
this.yesFocus(true); this.yesFocus(true);
}; };
PopupsAskViewModel.prototype.onBuild = function () AskPopupView.prototype.onBuild = function ()
{ {
key('tab, shift+tab, right, left', Enums.KeyState.PopupAsk, _.bind(function () { key('tab, shift+tab, right, left', Enums.KeyState.PopupAsk, _.bind(function () {
if (this.yesFocus()) if (this.yesFocus())
@ -126,6 +126,6 @@
}, this)); }, this));
}; };
module.exports = PopupsAskViewModel; module.exports = AskPopupView;
}()); }());

View file

@ -20,24 +20,24 @@
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
HtmlEditor = require('Common/HtmlEditor'), HtmlEditor = require('Common/HtmlEditor'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Cache = require('Storage:RainLoop:Cache'), Cache = require('Storage/App/Cache'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
ComposeAttachmentModel = require('Model/ComposeAttachment'), ComposeAttachmentModel = require('Model/ComposeAttachment'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsComposeViewModel() function ComposePopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsCompose'); AbstractView.call(this, 'Popups', 'PopupsCompose');
this.oEditor = null; this.oEditor = null;
this.aDraftInfo = null; this.aDraftInfo = null;
@ -211,8 +211,8 @@
this.deleteCommand = Utils.createCommand(this, function () { this.deleteCommand = Utils.createCommand(this, function () {
require('App:RainLoop').deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]); require('App/App').deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]);
kn.hideScreenPopup(PopupsComposeViewModel); kn.hideScreenPopup(ComposePopupView);
}, function () { }, function () {
return this.isDraftFolderMessage(); return this.isDraftFolderMessage();
@ -248,7 +248,7 @@
if ('' === sSentFolder) if ('' === sSentFolder)
{ {
kn.showScreenPopup(require('View:Popup:FolderSystem'), [Enums.SetSystemFoldersNotification.Sent]); kn.showScreenPopup(require('View/Popup/FolderSystem'), [Enums.SetSystemFoldersNotification.Sent]);
} }
else else
{ {
@ -270,7 +270,7 @@
} }
Cache.setMessageFlagsToCache(this.aDraftInfo[2], this.aDraftInfo[1], aFlagsCache); Cache.setMessageFlagsToCache(this.aDraftInfo[2], this.aDraftInfo[1], aFlagsCache);
require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache(); require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
Cache.setFolderHash(this.aDraftInfo[2], ''); Cache.setFolderHash(this.aDraftInfo[2], '');
} }
} }
@ -306,7 +306,7 @@
if (Data.draftFolderNotEnabled()) if (Data.draftFolderNotEnabled())
{ {
kn.showScreenPopup(require('View:Popup:FolderSystem'), [Enums.SetSystemFoldersNotification.Draft]); kn.showScreenPopup(require('View/Popup/FolderSystem'), [Enums.SetSystemFoldersNotification.Draft]);
} }
else else
{ {
@ -403,24 +403,24 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:Compose', 'PopupsComposeViewModel'], PopupsComposeViewModel); kn.extendAsViewModel(['View/Popup/Compose', 'PopupsComposeViewModel'], ComposePopupView);
_.extend(PopupsComposeViewModel.prototype, KnoinAbstractViewModel.prototype); _.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) { fResponse(_.map(aData, function (oEmailItem) {
return oEmailItem.toLine(false); return oEmailItem.toLine(false);
})); }));
}); });
}; };
PopupsComposeViewModel.prototype.openOpenPgpPopup = function () ComposePopupView.prototype.openOpenPgpPopup = function ()
{ {
if (this.capaOpenPGP() && this.oEditor && !this.oEditor.isHtml()) if (this.capaOpenPGP() && this.oEditor && !this.oEditor.isHtml())
{ {
var self = this; var self = this;
kn.showScreenPopup(require('View:Popup:ComposeOpenPgp'), [ kn.showScreenPopup(require('View/Popup/ComposeOpenPgp'), [
function (sResult) { function (sResult) {
self.editor(function (oEditor) { self.editor(function (oEditor) {
oEditor.setPlain(sResult); oEditor.setPlain(sResult);
@ -435,7 +435,7 @@
} }
}; };
PopupsComposeViewModel.prototype.reloadDraftFolder = function () ComposePopupView.prototype.reloadDraftFolder = function ()
{ {
var var
sDraftFolder = Data.draftFolder() sDraftFolder = Data.draftFolder()
@ -446,16 +446,16 @@
Cache.setFolderHash(sDraftFolder, ''); Cache.setFolderHash(sDraftFolder, '');
if (Data.currentFolderFullNameRaw() === sDraftFolder) if (Data.currentFolderFullNameRaw() === sDraftFolder)
{ {
require('App:RainLoop').reloadMessageList(true); require('App/App').reloadMessageList(true);
} }
else else
{ {
require('App:RainLoop').folderInformation(sDraftFolder); require('App/App').folderInformation(sDraftFolder);
} }
} }
}; };
PopupsComposeViewModel.prototype.findIdentityIdByMessage = function (sComposeType, oMessage) ComposePopupView.prototype.findIdentityIdByMessage = function (sComposeType, oMessage)
{ {
var var
oIDs = {}, oIDs = {},
@ -511,7 +511,7 @@
return sResult; return sResult;
}; };
PopupsComposeViewModel.prototype.selectIdentity = function (oIdentity) ComposePopupView.prototype.selectIdentity = function (oIdentity)
{ {
if (oIdentity) if (oIdentity)
{ {
@ -524,7 +524,7 @@
* @param {boolean=} bHeaderResult = false * @param {boolean=} bHeaderResult = false
* @returns {string} * @returns {string}
*/ */
PopupsComposeViewModel.prototype.formattedFrom = function (bHeaderResult) ComposePopupView.prototype.formattedFrom = function (bHeaderResult)
{ {
var var
sDisplayName = Data.displayName(), sDisplayName = Data.displayName(),
@ -538,7 +538,7 @@
; ;
}; };
PopupsComposeViewModel.prototype.sendMessageResponse = function (sResult, oData) ComposePopupView.prototype.sendMessageResponse = function (sResult, oData)
{ {
var var
bResult = false, bResult = false,
@ -576,7 +576,7 @@
this.reloadDraftFolder(); this.reloadDraftFolder();
}; };
PopupsComposeViewModel.prototype.saveMessageResponse = function (sResult, oData) ComposePopupView.prototype.saveMessageResponse = function (sResult, oData)
{ {
var var
bResult = false, bResult = false,
@ -630,7 +630,7 @@
this.reloadDraftFolder(); this.reloadDraftFolder();
}; };
PopupsComposeViewModel.prototype.onHide = function () ComposePopupView.prototype.onHide = function ()
{ {
this.reset(); this.reset();
kn.routeOn(); kn.routeOn();
@ -643,7 +643,7 @@
* @param {string=} sComposeType * @param {string=} sComposeType
* @return {string} * @return {string}
*/ */
PopupsComposeViewModel.prototype.convertSignature = function (sSignature, sFrom, sData, sComposeType) ComposePopupView.prototype.convertSignature = function (sSignature, sFrom, sData, sComposeType)
{ {
var bHtml = false, bData = false; var bHtml = false, bData = false;
if ('' !== sSignature) if ('' !== sSignature)
@ -698,7 +698,7 @@
return sSignature; return sSignature;
}; };
PopupsComposeViewModel.prototype.editor = function (fOnInit) ComposePopupView.prototype.editor = function (fOnInit)
{ {
if (fOnInit) if (fOnInit)
{ {
@ -727,7 +727,7 @@
* @param {string=} sCustomSubject = null * @param {string=} sCustomSubject = null
* @param {string=} sCustomPlainText = 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(); kn.routeOff();
@ -990,7 +990,7 @@
this.triggerForResize(); this.triggerForResize();
}; };
PopupsComposeViewModel.prototype.onFocus = function () ComposePopupView.prototype.onFocus = function ()
{ {
if ('' === this.to()) if ('' === this.to())
{ {
@ -1004,7 +1004,7 @@
this.triggerForResize(); this.triggerForResize();
}; };
PopupsComposeViewModel.prototype.editorResize = function () ComposePopupView.prototype.editorResize = function ()
{ {
if (this.oEditor) if (this.oEditor)
{ {
@ -1012,11 +1012,11 @@
} }
}; };
PopupsComposeViewModel.prototype.tryToClosePopup = function () ComposePopupView.prototype.tryToClosePopup = function ()
{ {
var var
self = this, self = this,
PopupsAskViewModel = require('View:Popup:Ask') PopupsAskViewModel = require('View/Popup/Ask')
; ;
if (!kn.isPopupVisible(PopupsAskViewModel)) if (!kn.isPopupVisible(PopupsAskViewModel))
@ -1030,7 +1030,7 @@
} }
}; };
PopupsComposeViewModel.prototype.onBuild = function () ComposePopupView.prototype.onBuild = function ()
{ {
this.initUploader(); this.initUploader();
@ -1087,7 +1087,7 @@
} }
}; };
PopupsComposeViewModel.prototype.driveCallback = function (sAccessToken, oData) ComposePopupView.prototype.driveCallback = function (sAccessToken, oData)
{ {
if (oData && window.XMLHttpRequest && window.google && if (oData && window.XMLHttpRequest && window.google &&
oData[window.google.picker.Response.ACTION] === window.google.picker.Action.PICKED && 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) if (window.gapi && oOauthToken && oOauthToken.access_token)
{ {
@ -1183,7 +1183,7 @@
} }
}; };
PopupsComposeViewModel.prototype.driveOpenPopup = function () ComposePopupView.prototype.driveOpenPopup = function ()
{ {
if (window.gapi) if (window.gapi)
{ {
@ -1238,7 +1238,7 @@
* @param {string} sId * @param {string} sId
* @return {?Object} * @return {?Object}
*/ */
PopupsComposeViewModel.prototype.getAttachmentById = function (sId) ComposePopupView.prototype.getAttachmentById = function (sId)
{ {
var var
aAttachments = this.attachments(), aAttachments = this.attachments(),
@ -1257,7 +1257,7 @@
return null; return null;
}; };
PopupsComposeViewModel.prototype.initUploader = function () ComposePopupView.prototype.initUploader = function ()
{ {
if (this.composeUploaderButton()) if (this.composeUploaderButton())
{ {
@ -1445,7 +1445,7 @@
/** /**
* @return {Object} * @return {Object}
*/ */
PopupsComposeViewModel.prototype.prepearAttachmentsForSendOrSave = function () ComposePopupView.prototype.prepearAttachmentsForSendOrSave = function ()
{ {
var oResult = {}; var oResult = {};
_.each(this.attachmentsInReady(), function (oItem) { _.each(this.attachmentsInReady(), function (oItem) {
@ -1466,7 +1466,7 @@
/** /**
* @param {MessageModel} oMessage * @param {MessageModel} oMessage
*/ */
PopupsComposeViewModel.prototype.addMessageAsAttachment = function (oMessage) ComposePopupView.prototype.addMessageAsAttachment = function (oMessage)
{ {
if (oMessage) if (oMessage)
{ {
@ -1500,7 +1500,7 @@
* @param {Object} oDropboxFile * @param {Object} oDropboxFile
* @return {boolean} * @return {boolean}
*/ */
PopupsComposeViewModel.prototype.addDropboxAttachment = function (oDropboxFile) ComposePopupView.prototype.addDropboxAttachment = function (oDropboxFile)
{ {
var var
self = this, self = this,
@ -1562,7 +1562,7 @@
* @param {string} sAccessToken * @param {string} sAccessToken
* @return {boolean} * @return {boolean}
*/ */
PopupsComposeViewModel.prototype.addDriveAttachment = function (oDriveFile, sAccessToken) ComposePopupView.prototype.addDriveAttachment = function (oDriveFile, sAccessToken)
{ {
var var
self = this, self = this,
@ -1624,7 +1624,7 @@
* @param {MessageModel} oMessage * @param {MessageModel} oMessage
* @param {string} sType * @param {string} sType
*/ */
PopupsComposeViewModel.prototype.prepearMessageAttachments = function (oMessage, sType) ComposePopupView.prototype.prepearMessageAttachments = function (oMessage, sType)
{ {
if (oMessage) if (oMessage)
{ {
@ -1687,14 +1687,14 @@
} }
}; };
PopupsComposeViewModel.prototype.removeLinkedAttachments = function () ComposePopupView.prototype.removeLinkedAttachments = function ()
{ {
this.attachments.remove(function (oItem) { this.attachments.remove(function (oItem) {
return oItem && oItem.isLinked; return oItem && oItem.isLinked;
}); });
}; };
PopupsComposeViewModel.prototype.setMessageAttachmentFailedDowbloadText = function () ComposePopupView.prototype.setMessageAttachmentFailedDowbloadText = function ()
{ {
_.each(this.attachments(), function(oAttachment) { _.each(this.attachments(), function(oAttachment) {
if (oAttachment && oAttachment.fromMessage) if (oAttachment && oAttachment.fromMessage)
@ -1712,7 +1712,7 @@
* @param {boolean=} bIncludeAttachmentInProgress = true * @param {boolean=} bIncludeAttachmentInProgress = true
* @return {boolean} * @return {boolean}
*/ */
PopupsComposeViewModel.prototype.isEmptyForm = function (bIncludeAttachmentInProgress) ComposePopupView.prototype.isEmptyForm = function (bIncludeAttachmentInProgress)
{ {
bIncludeAttachmentInProgress = Utils.isUnd(bIncludeAttachmentInProgress) ? true : !!bIncludeAttachmentInProgress; bIncludeAttachmentInProgress = Utils.isUnd(bIncludeAttachmentInProgress) ? true : !!bIncludeAttachmentInProgress;
var bAttach = bIncludeAttachmentInProgress ? var bAttach = bIncludeAttachmentInProgress ?
@ -1727,7 +1727,7 @@
; ;
}; };
PopupsComposeViewModel.prototype.reset = function () ComposePopupView.prototype.reset = function ()
{ {
this.to(''); this.to('');
this.cc(''); this.cc('');
@ -1770,7 +1770,7 @@
/** /**
* @return {Array} * @return {Array}
*/ */
PopupsComposeViewModel.prototype.getAttachmentsDownloadsForUpload = function () ComposePopupView.prototype.getAttachmentsDownloadsForUpload = function ()
{ {
return _.map(_.filter(this.attachments(), function (oItem) { return _.map(_.filter(this.attachments(), function (oItem) {
return oItem && '' === oItem.tempName(); return oItem && '' === oItem.tempName();
@ -1779,12 +1779,12 @@
}); });
}; };
PopupsComposeViewModel.prototype.triggerForResize = function () ComposePopupView.prototype.triggerForResize = function ()
{ {
this.resizer(!this.resizer()); this.resizer(!this.resizer());
this.editorResizeThrottle(); this.editorResizeThrottle();
}; };
module.exports = PopupsComposeViewModel; module.exports = ComposePopupView;
}()); }());

View file

@ -11,21 +11,21 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
EmailModel = require('Model/Email'), EmailModel = require('Model/Email'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsComposeOpenPgpViewModel() function ComposeOpenPgpPopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsComposeOpenPgp'); AbstractView.call(this, 'Popups', 'PopupsComposeOpenPgp');
this.notification = ko.observable(''); this.notification = ko.observable('');
@ -157,10 +157,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:ComposeOpenPgp', 'PopupsComposeOpenPgpViewModel'], PopupsComposeOpenPgpViewModel); kn.extendAsViewModel(['View/Popup/ComposeOpenPgp', 'PopupsComposeOpenPgpViewModel'], ComposeOpenPgpPopupView);
_.extend(PopupsComposeOpenPgpViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(ComposeOpenPgpPopupView.prototype, AbstractView.prototype);
PopupsComposeOpenPgpViewModel.prototype.clearPopup = function () ComposeOpenPgpPopupView.prototype.clearPopup = function ()
{ {
this.notification(''); this.notification('');
@ -177,7 +177,7 @@
this.resultCallback = null; this.resultCallback = null;
}; };
PopupsComposeOpenPgpViewModel.prototype.onBuild = function () ComposeOpenPgpPopupView.prototype.onBuild = function ()
{ {
key('tab,shift+tab', Enums.KeyState.PopupComposeOpenPGP, _.bind(function () { key('tab,shift+tab', Enums.KeyState.PopupComposeOpenPGP, _.bind(function () {
@ -196,12 +196,12 @@
}, this)); }, this));
}; };
PopupsComposeOpenPgpViewModel.prototype.onHide = function () ComposeOpenPgpPopupView.prototype.onHide = function ()
{ {
this.clearPopup(); this.clearPopup();
}; };
PopupsComposeOpenPgpViewModel.prototype.onFocus = function () ComposeOpenPgpPopupView.prototype.onFocus = function ()
{ {
if (this.sign()) 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(); this.clearPopup();
@ -259,6 +259,6 @@
this.text(sText); this.text(sText);
}; };
module.exports = PopupsComposeOpenPgpViewModel; module.exports = ComposeOpenPgpPopupView;
}()); }());

View file

@ -17,25 +17,25 @@
Selector = require('Common/Selector'), Selector = require('Common/Selector'),
LinkBuilder = require('Common/LinkBuilder'), LinkBuilder = require('Common/LinkBuilder'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
EmailModel = require('Model/Email'), EmailModel = require('Model/Email'),
ContactModel = require('Model/Contact'), ContactModel = require('Model/Contact'),
ContactTagModel = require('Model/ContactTag'), ContactTagModel = require('Model/ContactTag'),
ContactPropertyModel = require('Model/ContactProperty'), ContactPropertyModel = require('Model/ContactProperty'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsContactsViewModel() function ContactsPopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsContacts'); AbstractView.call(this, 'Popups', 'PopupsContacts');
var var
self = this, self = this,
@ -277,8 +277,8 @@
if (Utils.isNonEmptyArray(aE)) if (Utils.isNonEmptyArray(aE))
{ {
kn.hideScreenPopup(require('View:Popup:Contacts')); kn.hideScreenPopup(require('View/Popup/Contacts'));
kn.showScreenPopup(require('View:Popup:Compose'), [Enums.ComposeType.Empty, null, aE]); kn.showScreenPopup(require('View/Popup/Compose'), [Enums.ComposeType.Empty, null, aE]);
} }
}, function () { }, function () {
@ -349,7 +349,7 @@
this.syncCommand = Utils.createCommand(this, function () { this.syncCommand = Utils.createCommand(this, function () {
var self = this; 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) if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result)
{ {
window.alert(Utils.getNotification( window.alert(Utils.getNotification(
@ -390,19 +390,19 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:Contacts', 'PopupsContactsViewModel'], PopupsContactsViewModel); kn.extendAsViewModel(['View/Popup/Contacts', 'PopupsContactsViewModel'], ContactsPopupView);
_.extend(PopupsContactsViewModel.prototype, KnoinAbstractViewModel.prototype); _.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) { fResponse(_.map(aData, function (oTagItem) {
return oTagItem.toLine(false); return oTagItem.toLine(false);
})); }));
}); });
}; };
PopupsContactsViewModel.prototype.getPropertyPlceholder = function (sType) ContactsPopupView.prototype.getPropertyPlceholder = function (sType)
{ {
var sResult = ''; var sResult = '';
switch (sType) switch (sType)
@ -421,12 +421,12 @@
return sResult; 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))); 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) { var oItem = _.find(this.viewProperties(), function (oItem) {
return sType === oItem.type(); return sType === oItem.type();
@ -442,53 +442,53 @@
} }
}; };
PopupsContactsViewModel.prototype.addNewTag = function () ContactsPopupView.prototype.addNewTag = function ()
{ {
this.viewTags.visibility(true); this.viewTags.visibility(true);
this.viewTags.focusTrigger(true); this.viewTags.focusTrigger(true);
}; };
PopupsContactsViewModel.prototype.addNewEmail = function () ContactsPopupView.prototype.addNewEmail = function ()
{ {
this.addNewProperty(Enums.ContactPropertyType.Email, 'Home'); this.addNewProperty(Enums.ContactPropertyType.Email, 'Home');
}; };
PopupsContactsViewModel.prototype.addNewPhone = function () ContactsPopupView.prototype.addNewPhone = function ()
{ {
this.addNewProperty(Enums.ContactPropertyType.Phone, 'Mobile'); this.addNewProperty(Enums.ContactPropertyType.Phone, 'Mobile');
}; };
PopupsContactsViewModel.prototype.addNewWeb = function () ContactsPopupView.prototype.addNewWeb = function ()
{ {
this.addNewProperty(Enums.ContactPropertyType.Web); this.addNewProperty(Enums.ContactPropertyType.Web);
}; };
PopupsContactsViewModel.prototype.addNewNickname = function () ContactsPopupView.prototype.addNewNickname = function ()
{ {
this.addNewOrFocusProperty(Enums.ContactPropertyType.Nick); this.addNewOrFocusProperty(Enums.ContactPropertyType.Nick);
}; };
PopupsContactsViewModel.prototype.addNewNotes = function () ContactsPopupView.prototype.addNewNotes = function ()
{ {
this.addNewOrFocusProperty(Enums.ContactPropertyType.Note); this.addNewOrFocusProperty(Enums.ContactPropertyType.Note);
}; };
PopupsContactsViewModel.prototype.addNewBirthday = function () ContactsPopupView.prototype.addNewBirthday = function ()
{ {
this.addNewOrFocusProperty(Enums.ContactPropertyType.Birthday); 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()) if (this.importUploaderButton())
{ {
@ -528,7 +528,7 @@
} }
}; };
PopupsContactsViewModel.prototype.removeCheckedOrSelectedContactsFromList = function () ContactsPopupView.prototype.removeCheckedOrSelectedContactsFromList = function ()
{ {
var var
self = this, self = this,
@ -567,7 +567,7 @@
} }
}; };
PopupsContactsViewModel.prototype.deleteSelectedContacts = function () ContactsPopupView.prototype.deleteSelectedContacts = function ()
{ {
if (0 < this.contactsCheckedOrSelected().length) if (0 < this.contactsCheckedOrSelected().length)
{ {
@ -584,7 +584,7 @@
* @param {string} sResult * @param {string} sResult
* @param {AjaxJsonDefaultResponse} oData * @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)) 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); this.viewProperties.remove(oProp);
}; };
@ -608,7 +608,7 @@
/** /**
* @param {?ContactModel} oContact * @param {?ContactModel} oContact
*/ */
PopupsContactsViewModel.prototype.populateViewContact = function (oContact) ContactsPopupView.prototype.populateViewContact = function (oContact)
{ {
var var
sId = '', sId = '',
@ -672,7 +672,7 @@
/** /**
* @param {boolean=} bDropPagePosition = false * @param {boolean=} bDropPagePosition = false
*/ */
PopupsContactsViewModel.prototype.reloadContactList = function (bDropPagePosition) ContactsPopupView.prototype.reloadContactList = function (bDropPagePosition)
{ {
var var
self = this, self = this,
@ -732,7 +732,7 @@
}, iOffset, Consts.Defaults.ContactsPerPage, this.search()); }, iOffset, Consts.Defaults.ContactsPerPage, this.search());
}; };
PopupsContactsViewModel.prototype.onBuild = function (oDom) ContactsPopupView.prototype.onBuild = function (oDom)
{ {
this.oContentVisible = $('.b-list-content', oDom); this.oContentVisible = $('.b-list-content', oDom);
this.oContentScrollable = $('.content', this.oContentVisible); this.oContentScrollable = $('.content', this.oContentVisible);
@ -760,13 +760,13 @@
this.initUploader(); this.initUploader();
}; };
PopupsContactsViewModel.prototype.onShow = function () ContactsPopupView.prototype.onShow = function ()
{ {
kn.routeOff(); kn.routeOff();
this.reloadContactList(true); this.reloadContactList(true);
}; };
PopupsContactsViewModel.prototype.onHide = function () ContactsPopupView.prototype.onHide = function ()
{ {
kn.routeOn(); kn.routeOn();
this.currentContact(null); this.currentContact(null);
@ -776,6 +776,6 @@
this.contacts([]); this.contacts([]);
}; };
module.exports = PopupsContactsViewModel; module.exports = ContactsPopupView;
}()); }());

View file

@ -11,19 +11,19 @@
Consts = require('Common/Consts'), Consts = require('Common/Consts'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Remote = require('Storage:Admin:Remote'), Remote = require('Storage/Admin/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @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.edit = ko.observable(false);
this.saving = ko.observable(false); this.saving = ko.observable(false);
@ -199,10 +199,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:Domain', 'PopupsDomainViewModel'], PopupsDomainViewModel); kn.extendAsViewModel(['View/Popup/Domain', 'PopupsDomainViewModel'], DomainPopupView);
_.extend(PopupsDomainViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(DomainPopupView.prototype, AbstractView.prototype);
PopupsDomainViewModel.prototype.onTestConnectionResponse = function (sResult, oData) DomainPopupView.prototype.onTestConnectionResponse = function (sResult, oData)
{ {
this.testing(false); this.testing(false);
if (Enums.StorageResultType.Success === sResult && oData.Result) 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); this.saving(false);
if (Enums.StorageResultType.Success === sResult && oData) if (Enums.StorageResultType.Success === sResult && oData)
{ {
if (oData.Result) if (oData.Result)
{ {
require('App:Admin').reloadDomainList(); require('App/Admin').reloadDomainList();
this.closeCommand(); this.closeCommand();
} }
else if (Enums.Notification.DomainAlreadyExists === oData.ErrorCode) else if (Enums.Notification.DomainAlreadyExists === oData.ErrorCode)
@ -249,12 +249,12 @@
} }
}; };
PopupsDomainViewModel.prototype.onHide = function () DomainPopupView.prototype.onHide = function ()
{ {
this.whiteListPage(false); this.whiteListPage(false);
}; };
PopupsDomainViewModel.prototype.onShow = function (oDomain) DomainPopupView.prototype.onShow = function (oDomain)
{ {
this.saving(false); this.saving(false);
this.whiteListPage(false); this.whiteListPage(false);
@ -283,7 +283,7 @@
} }
}; };
PopupsDomainViewModel.prototype.onFocus = function () DomainPopupView.prototype.onFocus = function ()
{ {
if ('' === this.name()) if ('' === this.name())
{ {
@ -291,7 +291,7 @@
} }
}; };
PopupsDomainViewModel.prototype.clearForm = function () DomainPopupView.prototype.clearForm = function ()
{ {
this.edit(false); this.edit(false);
this.whiteListPage(false); this.whiteListPage(false);
@ -313,6 +313,6 @@
this.whiteList(''); this.whiteList('');
}; };
module.exports = PopupsDomainViewModel; module.exports = DomainPopupView;
}()); }());

53
dev/View/Popup/Filter.js Normal file
View file

@ -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;
}());

View file

@ -10,21 +10,21 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Cache = require('Storage:RainLoop:Cache'), Cache = require('Storage/App/Cache'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @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.selectedFolder = ko.observable(null);
this.clearingProcess = ko.observable(false); this.clearingProcess = ko.observable(false);
@ -70,7 +70,7 @@
self.clearingProcess(false); self.clearingProcess(false);
if (Enums.StorageResultType.Success === sResult && oData && oData.Result) if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{ {
require('App:RainLoop').reloadMessageList(true); require('App/App').reloadMessageList(true);
self.cancelCommand(); self.cancelCommand();
} }
else else
@ -101,16 +101,16 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:FolderClear', 'PopupsFolderClearViewModel'], PopupsFolderClearViewModel); kn.extendAsViewModel(['View/Popup/FolderClear', 'PopupsFolderClearViewModel'], FolderClearPopupView);
_.extend(PopupsFolderClearViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(FolderClearPopupView.prototype, AbstractView.prototype);
PopupsFolderClearViewModel.prototype.clearPopup = function () FolderClearPopupView.prototype.clearPopup = function ()
{ {
this.clearingProcess(false); this.clearingProcess(false);
this.selectedFolder(null); this.selectedFolder(null);
}; };
PopupsFolderClearViewModel.prototype.onShow = function (oFolder) FolderClearPopupView.prototype.onShow = function (oFolder)
{ {
this.clearPopup(); this.clearPopup();
if (oFolder) if (oFolder)
@ -119,6 +119,6 @@
} }
}; };
module.exports = PopupsFolderClearViewModel; module.exports = FolderClearPopupView;
}()); }());

View file

@ -11,20 +11,20 @@
Consts = require('Common/Consts'), Consts = require('Common/Consts'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsFolderCreateViewModel() function FolderCreateView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFolderCreate'); AbstractView.call(this, 'Popups', 'PopupsFolderCreate');
Utils.initOnStartOrLangChange(function () { Utils.initOnStartOrLangChange(function () {
this.sNoParentText = Utils.i18n('POPUPS_CREATE_FOLDER/SELECT_NO_PARENT'); this.sNoParentText = Utils.i18n('POPUPS_CREATE_FOLDER/SELECT_NO_PARENT');
@ -79,7 +79,7 @@
Data.foldersCreating(false); Data.foldersCreating(false);
if (Enums.StorageResultType.Success === sResult && oData && oData.Result) if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
{ {
require('App:RainLoop').folders(); require('App/App').folders();
} }
else else
{ {
@ -100,33 +100,33 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:FolderCreate', 'PopupsFolderCreateViewModel'], PopupsFolderCreateViewModel); kn.extendAsViewModel(['View/Popup/FolderCreate', 'PopupsFolderCreateViewModel'], FolderCreateView);
_.extend(PopupsFolderCreateViewModel.prototype, KnoinAbstractViewModel.prototype); _.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)); return (/^[^\\\/]+$/g).test(Utils.trim(sName));
}; };
PopupsFolderCreateViewModel.prototype.clearPopup = function () FolderCreateView.prototype.clearPopup = function ()
{ {
this.folderName(''); this.folderName('');
this.selectedParentValue(''); this.selectedParentValue('');
this.folderName.focused(false); this.folderName.focused(false);
}; };
PopupsFolderCreateViewModel.prototype.onShow = function () FolderCreateView.prototype.onShow = function ()
{ {
this.clearPopup(); this.clearPopup();
}; };
PopupsFolderCreateViewModel.prototype.onFocus = function () FolderCreateView.prototype.onFocus = function ()
{ {
this.folderName.focused(true); this.folderName.focused(true);
}; };
module.exports = PopupsFolderCreateViewModel; module.exports = FolderCreateView;
}()); }());

View file

@ -11,21 +11,21 @@
Consts = require('Common/Consts'), Consts = require('Common/Consts'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Settings = require('Storage:Settings'), Settings = require('Storage/Settings'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsFolderSystemViewModel() function FolderSystemPopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFolderSystem'); AbstractView.call(this, 'Popups', 'PopupsFolderSystem');
Utils.initOnStartOrLangChange(function () { Utils.initOnStartOrLangChange(function () {
this.sChooseOnText = Utils.i18n('POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE'); this.sChooseOnText = Utils.i18n('POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE');
@ -94,16 +94,16 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:FolderSystem', 'PopupsFolderSystemViewModel'], PopupsFolderSystemViewModel); kn.extendAsViewModel(['View/Popup/FolderSystem', 'PopupsFolderSystemViewModel'], FolderSystemPopupView);
_.extend(PopupsFolderSystemViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(FolderSystemPopupView.prototype, AbstractView.prototype);
PopupsFolderSystemViewModel.prototype.sChooseOnText = ''; FolderSystemPopupView.prototype.sChooseOnText = '';
PopupsFolderSystemViewModel.prototype.sUnuseText = ''; FolderSystemPopupView.prototype.sUnuseText = '';
/** /**
* @param {number=} iNotificationType = Enums.SetSystemFoldersNotification.None * @param {number=} iNotificationType = Enums.SetSystemFoldersNotification.None
*/ */
PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType) FolderSystemPopupView.prototype.onShow = function (iNotificationType)
{ {
var sNotification = ''; var sNotification = '';
@ -131,6 +131,6 @@
this.notification(sNotification); this.notification(sNotification);
}; };
module.exports = PopupsFolderSystemViewModel; module.exports = FolderSystemPopupView;
}()); }());

View file

@ -10,20 +10,20 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsIdentityViewModel() function IdentityPopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsIdentity'); AbstractView.call(this, 'Popups', 'PopupsIdentity');
this.id = ''; this.id = '';
this.edit = ko.observable(false); this.edit = ko.observable(false);
@ -83,7 +83,7 @@
{ {
if (oData.Result) if (oData.Result)
{ {
require('App:RainLoop').accountsAndIdentities(); require('App/App').accountsAndIdentities();
this.cancelCommand(); this.cancelCommand();
} }
else if (oData.ErrorCode) else if (oData.ErrorCode)
@ -115,10 +115,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:Identity', 'PopupsIdentityViewModel'], PopupsIdentityViewModel); kn.extendAsViewModel(['View/Popup/Identity', 'PopupsIdentityViewModel'], IdentityPopupView);
_.extend(PopupsIdentityViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(IdentityPopupView.prototype, AbstractView.prototype);
PopupsIdentityViewModel.prototype.clearPopup = function () IdentityPopupView.prototype.clearPopup = function ()
{ {
this.id = ''; this.id = '';
this.edit(false); this.edit(false);
@ -140,7 +140,7 @@
/** /**
* @param {?IdentityModel} oIdentity * @param {?IdentityModel} oIdentity
*/ */
PopupsIdentityViewModel.prototype.onShow = function (oIdentity) IdentityPopupView.prototype.onShow = function (oIdentity)
{ {
this.clearPopup(); this.clearPopup();
@ -158,7 +158,7 @@
} }
}; };
PopupsIdentityViewModel.prototype.onFocus = function () IdentityPopupView.prototype.onFocus = function ()
{ {
if (!this.owner()) if (!this.owner())
{ {
@ -166,6 +166,6 @@
} }
}; };
module.exports = PopupsIdentityViewModel; module.exports = IdentityPopupView;
}()); }());

View file

@ -9,27 +9,27 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsKeyboardShortcutsHelpViewModel() function KeyboardShortcutsHelpPopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsKeyboardShortcutsHelp'); AbstractView.call(this, 'Popups', 'PopupsKeyboardShortcutsHelp');
this.sDefaultKeyScope = Enums.KeyState.PopupKeyboardShortcutsHelp; this.sDefaultKeyScope = Enums.KeyState.PopupKeyboardShortcutsHelp;
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:KeyboardShortcutsHelp', 'PopupsKeyboardShortcutsHelpViewModel'], PopupsKeyboardShortcutsHelpViewModel); kn.extendAsViewModel(['View/Popup/KeyboardShortcutsHelp', 'PopupsKeyboardShortcutsHelpViewModel'], KeyboardShortcutsHelpPopupView);
_.extend(PopupsKeyboardShortcutsHelpViewModel.prototype, KnoinAbstractViewModel.prototype); _.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) { key('tab, shift+tab, left, right', Enums.KeyState.PopupKeyboardShortcutsHelp, _.bind(function (event, handler) {
if (event && handler) if (event && handler)
@ -59,6 +59,6 @@
}, this)); }, this));
}; };
module.exports = PopupsKeyboardShortcutsHelpViewModel; module.exports = KeyboardShortcutsHelpPopupView;
}()); }());

View file

@ -10,17 +10,17 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @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 this.Data = Globals.__APP__.data(); // TODO
@ -43,15 +43,15 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:Languages', 'PopupsLanguagesViewModel'], PopupsLanguagesViewModel); kn.extendAsViewModel(['View/Popup/Languages', 'PopupsLanguagesViewModel'], LanguagesPopupView);
_.extend(PopupsLanguagesViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(LanguagesPopupView.prototype, AbstractView.prototype);
PopupsLanguagesViewModel.prototype.languageEnName = function (sLanguage) LanguagesPopupView.prototype.languageEnName = function (sLanguage)
{ {
return Utils.convertLangName(sLanguage, true); return Utils.convertLangName(sLanguage, true);
}; };
PopupsLanguagesViewModel.prototype.resetMainLanguage = function () LanguagesPopupView.prototype.resetMainLanguage = function ()
{ {
var sCurrent = this.Data.mainLanguage(); var sCurrent = this.Data.mainLanguage();
_.each(this.languages(), function (oItem) { _.each(this.languages(), function (oItem) {
@ -59,24 +59,24 @@
}); });
}; };
PopupsLanguagesViewModel.prototype.onShow = function () LanguagesPopupView.prototype.onShow = function ()
{ {
this.exp(true); this.exp(true);
this.resetMainLanguage(); this.resetMainLanguage();
}; };
PopupsLanguagesViewModel.prototype.onHide = function () LanguagesPopupView.prototype.onHide = function ()
{ {
this.exp(false); this.exp(false);
}; };
PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang) LanguagesPopupView.prototype.changeLanguage = function (sLang)
{ {
this.Data.mainLanguage(sLang); this.Data.mainLanguage(sLang);
this.cancelCommand(); this.cancelCommand();
}; };
module.exports = PopupsLanguagesViewModel; module.exports = LanguagesPopupView;
}()); }());

View file

@ -9,19 +9,19 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Data = require('Storage:RainLoop:Data'), Data = require('Storage/App/Data'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @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 = ko.observable('');
this.email.focus = ko.observable(''); this.email.focus = ko.observable('');
@ -74,7 +74,7 @@
oOpenpgpKeyring.publicKeys.importKey(mKeyPair.publicKeyArmored); oOpenpgpKeyring.publicKeys.importKey(mKeyPair.publicKeyArmored);
oOpenpgpKeyring.store(); oOpenpgpKeyring.store();
require('App:RainLoop').reloadOpenPgpKeys(); require('App/App').reloadOpenPgpKeys();
Utils.delegateRun(self, 'cancelCommand'); Utils.delegateRun(self, 'cancelCommand');
} }
@ -87,10 +87,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:NewOpenPgpKey', 'PopupsNewOpenPgpKeyViewModel'], PopupsNewOpenPgpKeyViewModel); kn.extendAsViewModel(['View/Popup/NewOpenPgpKey', 'PopupsNewOpenPgpKeyViewModel'], NewOpenPgpKeyPopupView);
_.extend(PopupsNewOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(NewOpenPgpKeyPopupView.prototype, AbstractView.prototype);
PopupsNewOpenPgpKeyViewModel.prototype.clearPopup = function () NewOpenPgpKeyPopupView.prototype.clearPopup = function ()
{ {
this.name(''); this.name('');
this.password(''); this.password('');
@ -100,16 +100,16 @@
this.keyBitLength(2048); this.keyBitLength(2048);
}; };
PopupsNewOpenPgpKeyViewModel.prototype.onShow = function () NewOpenPgpKeyPopupView.prototype.onShow = function ()
{ {
this.clearPopup(); this.clearPopup();
}; };
PopupsNewOpenPgpKeyViewModel.prototype.onFocus = function () NewOpenPgpKeyPopupView.prototype.onFocus = function ()
{ {
this.email.focus(true); this.email.focus(true);
}; };
module.exports = PopupsNewOpenPgpKeyViewModel; module.exports = NewOpenPgpKeyPopupView;
}()); }());

View file

@ -11,19 +11,19 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Remote = require('Storage:Admin:Remote'), Remote = require('Storage/Admin/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsPluginViewModel() function PluginPopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsPlugin'); AbstractView.call(this, 'Popups', 'PopupsPlugin');
var self = this; var self = this;
@ -84,10 +84,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:Plugin', 'PopupsPluginViewModel'], PopupsPluginViewModel); kn.extendAsViewModel(['View/Popup/Plugin', 'PopupsPluginViewModel'], PluginPopupView);
_.extend(PopupsPluginViewModel.prototype, KnoinAbstractViewModel.prototype); _.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) 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.name();
this.readme(); this.readme();
@ -135,11 +135,11 @@
} }
}; };
PopupsPluginViewModel.prototype.tryToClosePopup = function () PluginPopupView.prototype.tryToClosePopup = function ()
{ {
var var
self = this, self = this,
PopupsAskViewModel = require('View:Popup:Ask') PopupsAskViewModel = require('View/Popup/Ask')
; ;
if (!kn.isPopupVisible(PopupsAskViewModel)) if (!kn.isPopupVisible(PopupsAskViewModel))
@ -153,7 +153,7 @@
} }
}; };
PopupsPluginViewModel.prototype.onBuild = function () PluginPopupView.prototype.onBuild = function ()
{ {
key('esc', Enums.KeyState.All, _.bind(function () { key('esc', Enums.KeyState.All, _.bind(function () {
if (this.modalVisibility()) if (this.modalVisibility())
@ -164,6 +164,6 @@
}, this)); }, this));
}; };
module.exports = PopupsPluginViewModel; module.exports = PluginPopupView;
}()); }());

View file

@ -10,19 +10,19 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Remote = require('Storage:RainLoop:Remote'), Remote = require('Storage/App/Remote'),
kn = require('App:Knoin'), kn = require('Knoin/Knoin'),
KnoinAbstractViewModel = require('Knoin:AbstractViewModel') AbstractView = require('Knoin/AbstractView')
; ;
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends AbstractView
*/ */
function PopupsTwoFactorTestViewModel() function TwoFactorTestPopupView()
{ {
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsTwoFactorTest'); AbstractView.call(this, 'Popups', 'PopupsTwoFactorTest');
var self = this; var self = this;
@ -50,10 +50,10 @@
kn.constructorEnd(this); kn.constructorEnd(this);
} }
kn.extendAsViewModel(['View:Popup:TwoFactorTest', 'PopupsTwoFactorTestViewModel'], PopupsTwoFactorTestViewModel); kn.extendAsViewModel(['View/Popup/TwoFactorTest', 'PopupsTwoFactorTestViewModel'], TwoFactorTestPopupView);
_.extend(PopupsTwoFactorTestViewModel.prototype, KnoinAbstractViewModel.prototype); _.extend(TwoFactorTestPopupView.prototype, AbstractView.prototype);
PopupsTwoFactorTestViewModel.prototype.clearPopup = function () TwoFactorTestPopupView.prototype.clearPopup = function ()
{ {
this.code(''); this.code('');
this.code.focused(false); this.code.focused(false);
@ -61,16 +61,16 @@
this.testing(false); this.testing(false);
}; };
PopupsTwoFactorTestViewModel.prototype.onShow = function () TwoFactorTestPopupView.prototype.onShow = function ()
{ {
this.clearPopup(); this.clearPopup();
}; };
PopupsTwoFactorTestViewModel.prototype.onFocus = function () TwoFactorTestPopupView.prototype.onFocus = function ()
{ {
this.code.focused(true); this.code.focused(true);
}; };
module.exports = PopupsTwoFactorTestViewModel; module.exports = TwoFactorTestPopupView;
}()); }());

View file

@ -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;
}());

View file

@ -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;
}());

View file

@ -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;
}());

View file

@ -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;
}());

View file

@ -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;
}());

View file

@ -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;
}());

View file

@ -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;
}());

Some files were not shown because too many files have changed in this diff Show more