mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Code refactoring
Fixed owncloud password encoder/decoder (#291) Fixed ckeditor in ownCloud iframe (Closes #302) Release commit
This commit is contained in:
parent
7a374ebe03
commit
06274c6a7c
112 changed files with 2667 additions and 1862 deletions
|
|
@ -49,7 +49,7 @@ class OC_RainLoop_Helper
|
|||
if (function_exists('mcrypt_encrypt') && function_exists('mcrypt_create_iv') && function_exists('mcrypt_get_iv_size') &&
|
||||
defined('MCRYPT_RIJNDAEL_256') && defined('MCRYPT_MODE_ECB') && defined('MCRYPT_RAND'))
|
||||
{
|
||||
return @trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($sSalt), $sPassword,
|
||||
return @trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($sSalt), base64_encode($sPassword),
|
||||
MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
|
||||
}
|
||||
|
||||
|
|
@ -61,8 +61,8 @@ class OC_RainLoop_Helper
|
|||
if (function_exists('mcrypt_encrypt') && function_exists('mcrypt_create_iv') && function_exists('mcrypt_get_iv_size') &&
|
||||
defined('MCRYPT_RIJNDAEL_256') && defined('MCRYPT_MODE_ECB') && defined('MCRYPT_RAND'))
|
||||
{
|
||||
return @mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($sSalt), base64_decode(trim($sPassword)),
|
||||
MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND));
|
||||
return @base64_decode(trim(@mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($sSalt), base64_decode(trim($sPassword)),
|
||||
MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));
|
||||
}
|
||||
|
||||
return @base64_decode(trim($sPassword));
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
(function (require) {
|
||||
'use strict';
|
||||
require('App:Boot')(require('App:Admin'));
|
||||
}(require));
|
||||
|
|
@ -13,19 +13,19 @@
|
|||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
Events = require('Common/Events'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Settings = require('Storage/Settings'),
|
||||
|
||||
KnoinAbstractBoot = require('Knoin:AbstractBoot')
|
||||
AbstractBoot = require('Knoin/AbstractBoot')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {RemoteStorage|AdminRemoteStorage} Remote
|
||||
* @extends KnoinAbstractBoot
|
||||
* @extends AbstractBoot
|
||||
*/
|
||||
function AbstractApp(Remote)
|
||||
{
|
||||
KnoinAbstractBoot.call(this);
|
||||
AbstractBoot.call(this);
|
||||
|
||||
this.isLocalAutocomplete = true;
|
||||
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
_.extend(AbstractApp.prototype, KnoinAbstractBoot.prototype);
|
||||
_.extend(AbstractApp.prototype, AbstractBoot.prototype);
|
||||
|
||||
AbstractApp.prototype.remote = function ()
|
||||
{
|
||||
|
|
@ -136,7 +136,7 @@
|
|||
AbstractApp.prototype.loginAndLogoutReload = function (bLogout, bClose)
|
||||
{
|
||||
var
|
||||
kn = require('App:Knoin'),
|
||||
kn = require('Knoin/Knoin'),
|
||||
sCustomLogoutLink = Utils.pString(Settings.settingsGet('CustomLogoutLink')),
|
||||
bInIframe = !!Settings.settingsGet('InIframe')
|
||||
;
|
||||
|
|
@ -12,15 +12,12 @@
|
|||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:Admin:Data'),
|
||||
Remote = require('Storage:Admin:Remote'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data'),
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
|
||||
AdminSettingsScreen = require('Screen:Admin:Settings'),
|
||||
AdminLoginScreen = require('Screen:Admin:Login'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
AbstractApp = require('App:Abstract')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractApp = require('App/Abstract')
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
@ -254,11 +251,15 @@
|
|||
{
|
||||
if (!!Settings.settingsGet('Auth'))
|
||||
{
|
||||
kn.startScreens([AdminSettingsScreen]);
|
||||
kn.startScreens([
|
||||
require('Screen/Admin/Settings')
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
kn.startScreens([AdminLoginScreen]);
|
||||
kn.startScreens([
|
||||
require('Screen/Admin/Login')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -17,13 +17,13 @@
|
|||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
Events = require('Common/Events'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
||||
Local = require('Storage:LocalStorage'),
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Cache = require('Storage:RainLoop:Cache'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Local = require('Storage/Local'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Cache = require('Storage/App/Cache'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
EmailModel = require('Model/Email'),
|
||||
FolderModel = require('Model/Folder'),
|
||||
|
|
@ -32,14 +32,14 @@
|
|||
IdentityModel = require('Model/Identity'),
|
||||
OpenPgpKeyModel = require('Model/OpenPgpKey'),
|
||||
|
||||
AbstractApp = require('App:Abstract')
|
||||
AbstractApp = require('App/Abstract')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractApp
|
||||
*/
|
||||
function RainLoopApp()
|
||||
function AppApp()
|
||||
{
|
||||
AbstractApp.call(this, Remote);
|
||||
|
||||
|
|
@ -102,19 +102,19 @@
|
|||
this.socialUsers = _.bind(this.socialUsers, this);
|
||||
}
|
||||
|
||||
_.extend(RainLoopApp.prototype, AbstractApp.prototype);
|
||||
_.extend(AppApp.prototype, AbstractApp.prototype);
|
||||
|
||||
RainLoopApp.prototype.remote = function ()
|
||||
AppApp.prototype.remote = function ()
|
||||
{
|
||||
return Remote;
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.data = function ()
|
||||
AppApp.prototype.data = function ()
|
||||
{
|
||||
return Data;
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.reloadFlagsCurrentMessageListAndMessageFromCache = function ()
|
||||
AppApp.prototype.reloadFlagsCurrentMessageListAndMessageFromCache = function ()
|
||||
{
|
||||
_.each(Data.messageList(), function (oMessage) {
|
||||
Cache.initMessageFlagsFromCache(oMessage);
|
||||
|
|
@ -127,7 +127,7 @@
|
|||
* @param {boolean=} bDropPagePosition = false
|
||||
* @param {boolean=} bDropCurrenFolderCache = false
|
||||
*/
|
||||
RainLoopApp.prototype.reloadMessageList = function (bDropPagePosition, bDropCurrenFolderCache)
|
||||
AppApp.prototype.reloadMessageList = function (bDropPagePosition, bDropCurrenFolderCache)
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -171,12 +171,12 @@
|
|||
}, Data.currentFolderFullNameRaw(), iOffset, Data.messagesPerPage(), Data.messageListSearch());
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.recacheInboxMessageList = function ()
|
||||
AppApp.prototype.recacheInboxMessageList = function ()
|
||||
{
|
||||
Remote.messageList(Utils.emptyFunction, 'INBOX', 0, Data.messagesPerPage(), '', true);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.reloadMessageListHelper = function (bEmptyList)
|
||||
AppApp.prototype.reloadMessageListHelper = function (bEmptyList)
|
||||
{
|
||||
this.reloadMessageList(bEmptyList);
|
||||
};
|
||||
|
|
@ -185,7 +185,7 @@
|
|||
* @param {Function} fResultFunc
|
||||
* @returns {boolean}
|
||||
*/
|
||||
RainLoopApp.prototype.contactsSync = function (fResultFunc)
|
||||
AppApp.prototype.contactsSync = function (fResultFunc)
|
||||
{
|
||||
var oContacts = Data.contacts;
|
||||
if (oContacts.importing() || oContacts.syncing() || !Data.enableContactsSync() || !Data.allowContactsSync())
|
||||
|
|
@ -208,7 +208,7 @@
|
|||
return true;
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesMoveTrigger = function ()
|
||||
AppApp.prototype.messagesMoveTrigger = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -229,7 +229,7 @@
|
|||
this.oMoveCache = {};
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesMoveHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForMove)
|
||||
AppApp.prototype.messagesMoveHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForMove)
|
||||
{
|
||||
var sH = '$$' + sFromFolderFullNameRaw + '$$' + sToFolderFullNameRaw + '$$';
|
||||
if (!this.oMoveCache[sH])
|
||||
|
|
@ -245,7 +245,7 @@
|
|||
this.messagesMoveTrigger();
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesCopyHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForCopy)
|
||||
AppApp.prototype.messagesCopyHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForCopy)
|
||||
{
|
||||
Remote.messagesCopy(
|
||||
this.moveOrDeleteResponseHelper,
|
||||
|
|
@ -255,7 +255,7 @@
|
|||
);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.messagesDeleteHelper = function (sFromFolderFullNameRaw, aUidForRemove)
|
||||
AppApp.prototype.messagesDeleteHelper = function (sFromFolderFullNameRaw, aUidForRemove)
|
||||
{
|
||||
Remote.messagesDelete(
|
||||
this.moveOrDeleteResponseHelper,
|
||||
|
|
@ -264,7 +264,7 @@
|
|||
);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.moveOrDeleteResponseHelper = function (sResult, oData)
|
||||
AppApp.prototype.moveOrDeleteResponseHelper = function (sResult, oData)
|
||||
{
|
||||
if (Enums.StorageResultType.Success === sResult && Data.currentFolder())
|
||||
{
|
||||
|
|
@ -292,7 +292,7 @@
|
|||
* @param {string} sFromFolderFullNameRaw
|
||||
* @param {Array} aUidForRemove
|
||||
*/
|
||||
RainLoopApp.prototype.deleteMessagesFromFolderWithoutCheck = function (sFromFolderFullNameRaw, aUidForRemove)
|
||||
AppApp.prototype.deleteMessagesFromFolderWithoutCheck = function (sFromFolderFullNameRaw, aUidForRemove)
|
||||
{
|
||||
this.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove);
|
||||
Data.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove);
|
||||
|
|
@ -304,7 +304,7 @@
|
|||
* @param {Array} aUidForRemove
|
||||
* @param {boolean=} bUseFolder = true
|
||||
*/
|
||||
RainLoopApp.prototype.deleteMessagesFromFolder = function (iDeleteType, sFromFolderFullNameRaw, aUidForRemove, bUseFolder)
|
||||
AppApp.prototype.deleteMessagesFromFolder = function (iDeleteType, sFromFolderFullNameRaw, aUidForRemove, bUseFolder)
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -344,12 +344,12 @@
|
|||
|
||||
if (!oMoveFolder && bUseFolder)
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:FolderSystem'), [nSetSystemFoldersNotification]);
|
||||
kn.showScreenPopup(require('View/Popup/FolderSystem'), [nSetSystemFoldersNotification]);
|
||||
}
|
||||
else if (!bUseFolder || (Enums.FolderType.Trash === iDeleteType &&
|
||||
(sFromFolderFullNameRaw === Data.spamFolder() || sFromFolderFullNameRaw === Data.trashFolder())))
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:Ask'), [Utils.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () {
|
||||
kn.showScreenPopup(require('View/Popup/Ask'), [Utils.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () {
|
||||
|
||||
self.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove);
|
||||
Data.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove);
|
||||
|
|
@ -369,7 +369,7 @@
|
|||
* @param {string} sToFolderFullNameRaw
|
||||
* @param {boolean=} bCopy = false
|
||||
*/
|
||||
RainLoopApp.prototype.moveMessagesToFolder = function (sFromFolderFullNameRaw, aUidForMove, sToFolderFullNameRaw, bCopy)
|
||||
AppApp.prototype.moveMessagesToFolder = function (sFromFolderFullNameRaw, aUidForMove, sToFolderFullNameRaw, bCopy)
|
||||
{
|
||||
if (sFromFolderFullNameRaw !== sToFolderFullNameRaw && Utils.isArray(aUidForMove) && 0 < aUidForMove.length)
|
||||
{
|
||||
|
|
@ -400,7 +400,7 @@
|
|||
/**
|
||||
* @param {Function=} fCallback
|
||||
*/
|
||||
RainLoopApp.prototype.folders = function (fCallback)
|
||||
AppApp.prototype.folders = function (fCallback)
|
||||
{
|
||||
Data.foldersLoading(true);
|
||||
Remote.folders(_.bind(function (sResult, oData) {
|
||||
|
|
@ -424,7 +424,7 @@
|
|||
}, this));
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.reloadOpenPgpKeys = function ()
|
||||
AppApp.prototype.reloadOpenPgpKeys = function ()
|
||||
{
|
||||
if (Data.capaOpenPGP())
|
||||
{
|
||||
|
|
@ -467,7 +467,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.accountsAndIdentities = function ()
|
||||
AppApp.prototype.accountsAndIdentities = function ()
|
||||
{
|
||||
Data.accountsLoading(true);
|
||||
Data.identitiesLoading(true);
|
||||
|
|
@ -514,7 +514,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.quota = function ()
|
||||
AppApp.prototype.quota = function ()
|
||||
{
|
||||
Remote.quota(function (sResult, oData) {
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result &&
|
||||
|
|
@ -531,7 +531,7 @@
|
|||
* @param {string} sFolder
|
||||
* @param {Array=} aList = []
|
||||
*/
|
||||
RainLoopApp.prototype.folderInformation = function (sFolder, aList)
|
||||
AppApp.prototype.folderInformation = function (sFolder, aList)
|
||||
{
|
||||
if ('' !== Utils.trim(sFolder))
|
||||
{
|
||||
|
|
@ -635,7 +635,7 @@
|
|||
/**
|
||||
* @param {boolean=} bBoot = false
|
||||
*/
|
||||
RainLoopApp.prototype.folderInformationMultiply = function (bBoot)
|
||||
AppApp.prototype.folderInformationMultiply = function (bBoot)
|
||||
{
|
||||
bBoot = Utils.isUnd(bBoot) ? false : !!bBoot;
|
||||
|
||||
|
|
@ -721,7 +721,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.setMessageSeen = function (oMessage)
|
||||
AppApp.prototype.setMessageSeen = function (oMessage)
|
||||
{
|
||||
if (oMessage.unseen())
|
||||
{
|
||||
|
|
@ -741,17 +741,17 @@
|
|||
Remote.messageSetSeen(Utils.emptyFunction, oMessage.folderFullNameRaw, [oMessage.uid], true);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.googleConnect = function ()
|
||||
AppApp.prototype.googleConnect = function ()
|
||||
{
|
||||
window.open(LinkBuilder.socialGoogle(), 'Google', 'left=200,top=100,width=650,height=600,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.twitterConnect = function ()
|
||||
AppApp.prototype.twitterConnect = function ()
|
||||
{
|
||||
window.open(LinkBuilder.socialTwitter(), 'Twitter', 'left=200,top=100,width=650,height=350,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.facebookConnect = function ()
|
||||
AppApp.prototype.facebookConnect = function ()
|
||||
{
|
||||
window.open(LinkBuilder.socialFacebook(), 'Facebook', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||
};
|
||||
|
|
@ -759,7 +759,7 @@
|
|||
/**
|
||||
* @param {boolean=} bFireAllActions
|
||||
*/
|
||||
RainLoopApp.prototype.socialUsers = function (bFireAllActions)
|
||||
AppApp.prototype.socialUsers = function (bFireAllActions)
|
||||
{
|
||||
if (bFireAllActions)
|
||||
{
|
||||
|
|
@ -793,19 +793,19 @@
|
|||
});
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.googleDisconnect = function ()
|
||||
AppApp.prototype.googleDisconnect = function ()
|
||||
{
|
||||
Data.googleActions(true);
|
||||
Remote.googleDisconnect(this.socialUsers);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.facebookDisconnect = function ()
|
||||
AppApp.prototype.facebookDisconnect = function ()
|
||||
{
|
||||
Data.facebookActions(true);
|
||||
Remote.facebookDisconnect(this.socialUsers);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.twitterDisconnect = function ()
|
||||
AppApp.prototype.twitterDisconnect = function ()
|
||||
{
|
||||
Data.twitterActions(true);
|
||||
Remote.twitterDisconnect(this.socialUsers);
|
||||
|
|
@ -815,7 +815,7 @@
|
|||
* @param {string} sQuery
|
||||
* @param {Function} fCallback
|
||||
*/
|
||||
RainLoopApp.prototype.getAutocomplete = function (sQuery, fCallback)
|
||||
AppApp.prototype.getAutocomplete = function (sQuery, fCallback)
|
||||
{
|
||||
var
|
||||
aData = []
|
||||
|
|
@ -842,14 +842,14 @@
|
|||
* @param {string} sQuery
|
||||
* @param {Function} fCallback
|
||||
*/
|
||||
RainLoopApp.prototype.getContactTagsAutocomplete = function (sQuery, fCallback)
|
||||
AppApp.prototype.getContactTagsAutocomplete = function (sQuery, fCallback)
|
||||
{
|
||||
fCallback(_.filter(Data.contactTags(), function (oContactTag) {
|
||||
return oContactTag && oContactTag.filterHelper(sQuery);
|
||||
}));
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.setMessageList = function (oData, bCached)
|
||||
AppApp.prototype.setMessageList = function (oData, bCached)
|
||||
{
|
||||
if (oData && oData.Result && 'Collection/MessageCollection' === oData.Result['@Object'] &&
|
||||
oData.Result['@Collection'] && Utils.isArray(oData.Result['@Collection']))
|
||||
|
|
@ -984,7 +984,7 @@
|
|||
* @param {Array} aFolders
|
||||
* @return {Array}
|
||||
*/
|
||||
RainLoopApp.prototype.folderResponseParseRec = function (sNamespace, aFolders)
|
||||
AppApp.prototype.folderResponseParseRec = function (sNamespace, aFolders)
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -1056,7 +1056,7 @@
|
|||
/**
|
||||
* @param {*} oData
|
||||
*/
|
||||
RainLoopApp.prototype.setFolders = function (oData)
|
||||
AppApp.prototype.setFolders = function (oData)
|
||||
{
|
||||
var
|
||||
aList = [],
|
||||
|
|
@ -1121,7 +1121,7 @@
|
|||
* @param {string} sFullNameHash
|
||||
* @return {boolean}
|
||||
*/
|
||||
RainLoopApp.prototype.isFolderExpanded = function (sFullNameHash)
|
||||
AppApp.prototype.isFolderExpanded = function (sFullNameHash)
|
||||
{
|
||||
var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders);
|
||||
return Utils.isArray(aExpandedList) && -1 !== _.indexOf(aExpandedList, sFullNameHash);
|
||||
|
|
@ -1131,7 +1131,7 @@
|
|||
* @param {string} sFullNameHash
|
||||
* @param {boolean} bExpanded
|
||||
*/
|
||||
RainLoopApp.prototype.setExpandedFolder = function (sFullNameHash, bExpanded)
|
||||
AppApp.prototype.setExpandedFolder = function (sFullNameHash, bExpanded)
|
||||
{
|
||||
var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders);
|
||||
if (!Utils.isArray(aExpandedList))
|
||||
|
|
@ -1152,7 +1152,7 @@
|
|||
Local.set(Enums.ClientSideKeyName.ExpandedFolders, aExpandedList);
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.initLayoutResizer = function (sLeft, sRight, sClientSideKeyName)
|
||||
AppApp.prototype.initLayoutResizer = function (sLeft, sRight, sClientSideKeyName)
|
||||
{
|
||||
var
|
||||
iDisabledWidth = 60,
|
||||
|
|
@ -1223,7 +1223,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.bootstartLoginScreen = function ()
|
||||
AppApp.prototype.bootstartLoginScreen = function ()
|
||||
{
|
||||
var sCustomLoginLink = Utils.pString(Settings.settingsGet('CustomLoginLink'));
|
||||
if (!sCustomLoginLink)
|
||||
|
|
@ -1231,7 +1231,7 @@
|
|||
kn.hideLoading();
|
||||
|
||||
kn.startScreens([
|
||||
require('Screen:RainLoop:Login')
|
||||
require('Screen/App/Login')
|
||||
]);
|
||||
|
||||
Plugins.runHook('rl-start-login-screens');
|
||||
|
|
@ -1249,7 +1249,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.bootstart = function ()
|
||||
AppApp.prototype.bootstart = function ()
|
||||
{
|
||||
AbstractApp.prototype.bootstart.call(this);
|
||||
|
||||
|
|
@ -1298,123 +1298,119 @@
|
|||
{
|
||||
this.setTitle(Utils.i18n('TITLES/LOADING'));
|
||||
|
||||
require.ensure([], function () {
|
||||
self.folders(_.bind(function (bValue) {
|
||||
|
||||
self.folders(_.bind(function (bValue) {
|
||||
kn.hideLoading();
|
||||
|
||||
kn.hideLoading();
|
||||
|
||||
if (bValue)
|
||||
if (bValue)
|
||||
{
|
||||
if (window.$LAB && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP))
|
||||
{
|
||||
if (window.$LAB && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP))
|
||||
{
|
||||
window.$LAB.script(window.openpgp ? '' : LinkBuilder.openPgpJs()).wait(function () {
|
||||
if (window.openpgp)
|
||||
{
|
||||
Data.openpgp = window.openpgp;
|
||||
Data.openpgpKeyring = new window.openpgp.Keyring();
|
||||
Data.capaOpenPGP(true);
|
||||
|
||||
Events.pub('openpgp.init');
|
||||
|
||||
self.reloadOpenPgpKeys();
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Data.capaOpenPGP(false);
|
||||
}
|
||||
|
||||
kn.startScreens([
|
||||
require('Screen:RainLoop:MailBox'),
|
||||
require('Screen:RainLoop:Settings'),
|
||||
require('Screen:RainLoop:About')
|
||||
]);
|
||||
|
||||
if (bGoogle || bFacebook || bTwitter)
|
||||
{
|
||||
self.socialUsers(true);
|
||||
}
|
||||
|
||||
Events.sub('interval.2m', function () {
|
||||
self.folderInformation('INBOX');
|
||||
});
|
||||
|
||||
Events.sub('interval.2m', function () {
|
||||
var sF = Data.currentFolderFullNameRaw();
|
||||
if ('INBOX' !== sF)
|
||||
window.$LAB.script(window.openpgp ? '' : LinkBuilder.openPgpJs()).wait(function () {
|
||||
if (window.openpgp)
|
||||
{
|
||||
self.folderInformation(sF);
|
||||
Data.openpgp = window.openpgp;
|
||||
Data.openpgpKeyring = new window.openpgp.Keyring();
|
||||
Data.capaOpenPGP(true);
|
||||
|
||||
Events.pub('openpgp.init');
|
||||
|
||||
self.reloadOpenPgpKeys();
|
||||
}
|
||||
});
|
||||
|
||||
Events.sub('interval.3m', function () {
|
||||
self.folderInformationMultiply();
|
||||
});
|
||||
|
||||
Events.sub('interval.5m', function () {
|
||||
self.quota();
|
||||
});
|
||||
|
||||
Events.sub('interval.10m', function () {
|
||||
self.folders();
|
||||
});
|
||||
|
||||
iContactsSyncInterval = 5 <= iContactsSyncInterval ? iContactsSyncInterval : 20;
|
||||
iContactsSyncInterval = 320 >= iContactsSyncInterval ? iContactsSyncInterval : 320;
|
||||
|
||||
window.setInterval(function () {
|
||||
self.contactsSync();
|
||||
}, iContactsSyncInterval * 60000 + 5000);
|
||||
|
||||
_.delay(function () {
|
||||
self.contactsSync();
|
||||
}, 5000);
|
||||
|
||||
_.delay(function () {
|
||||
self.folderInformationMultiply(true);
|
||||
}, 500);
|
||||
|
||||
Plugins.runHook('rl-start-user-screens');
|
||||
Events.pub('rl.bootstart-user-screens');
|
||||
|
||||
if (!!Settings.settingsGet('AccountSignMe') && window.navigator.registerProtocolHandler)
|
||||
{
|
||||
_.delay(function () {
|
||||
try {
|
||||
window.navigator.registerProtocolHandler('mailto',
|
||||
window.location.protocol + '//' + window.location.host + window.location.pathname + '?mailto&to=%s',
|
||||
'' + (Settings.settingsGet('Title') || 'RainLoop'));
|
||||
} catch(e) {}
|
||||
|
||||
if (Settings.settingsGet('MailToEmail'))
|
||||
{
|
||||
Utils.mailToHelper(Settings.settingsGet('MailToEmail'), require('View:Popup:Compose'));
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
if (!Globals.bMobileDevice)
|
||||
{
|
||||
_.defer(function () {
|
||||
self.initLayoutResizer('#rl-left', '#rl-right', Enums.ClientSideKeyName.FolderListSize);
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self.bootstartLoginScreen();
|
||||
Data.capaOpenPGP(false);
|
||||
}
|
||||
|
||||
if (window.SimplePace)
|
||||
kn.startScreens([
|
||||
require('Screen/App/MailBox'),
|
||||
require('Screen/App/Settings'),
|
||||
require('Screen/App/About')
|
||||
]);
|
||||
|
||||
if (bGoogle || bFacebook || bTwitter)
|
||||
{
|
||||
window.SimplePace.set(100);
|
||||
self.socialUsers(true);
|
||||
}
|
||||
|
||||
}, self));
|
||||
Events.sub('interval.2m', function () {
|
||||
self.folderInformation('INBOX');
|
||||
});
|
||||
|
||||
});
|
||||
Events.sub('interval.2m', function () {
|
||||
var sF = Data.currentFolderFullNameRaw();
|
||||
if ('INBOX' !== sF)
|
||||
{
|
||||
self.folderInformation(sF);
|
||||
}
|
||||
});
|
||||
|
||||
Events.sub('interval.3m', function () {
|
||||
self.folderInformationMultiply();
|
||||
});
|
||||
|
||||
Events.sub('interval.5m', function () {
|
||||
self.quota();
|
||||
});
|
||||
|
||||
Events.sub('interval.10m', function () {
|
||||
self.folders();
|
||||
});
|
||||
|
||||
iContactsSyncInterval = 5 <= iContactsSyncInterval ? iContactsSyncInterval : 20;
|
||||
iContactsSyncInterval = 320 >= iContactsSyncInterval ? iContactsSyncInterval : 320;
|
||||
|
||||
window.setInterval(function () {
|
||||
self.contactsSync();
|
||||
}, iContactsSyncInterval * 60000 + 5000);
|
||||
|
||||
_.delay(function () {
|
||||
self.contactsSync();
|
||||
}, 5000);
|
||||
|
||||
_.delay(function () {
|
||||
self.folderInformationMultiply(true);
|
||||
}, 500);
|
||||
|
||||
Plugins.runHook('rl-start-user-screens');
|
||||
Events.pub('rl.bootstart-user-screens');
|
||||
|
||||
if (!!Settings.settingsGet('AccountSignMe') && window.navigator.registerProtocolHandler)
|
||||
{
|
||||
_.delay(function () {
|
||||
try {
|
||||
window.navigator.registerProtocolHandler('mailto',
|
||||
window.location.protocol + '//' + window.location.host + window.location.pathname + '?mailto&to=%s',
|
||||
'' + (Settings.settingsGet('Title') || 'RainLoop'));
|
||||
} catch(e) {}
|
||||
|
||||
if (Settings.settingsGet('MailToEmail'))
|
||||
{
|
||||
Utils.mailToHelper(Settings.settingsGet('MailToEmail'), require('View/Popup/Compose'));
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
if (!Globals.bMobileDevice)
|
||||
{
|
||||
_.defer(function () {
|
||||
self.initLayoutResizer('#rl-left', '#rl-right', Enums.ClientSideKeyName.FolderListSize);
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self.bootstartLoginScreen();
|
||||
}
|
||||
|
||||
if (window.SimplePace)
|
||||
{
|
||||
window.SimplePace.set(100);
|
||||
}
|
||||
|
||||
}, self));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1458,6 +1454,6 @@
|
|||
Events.pub('rl.bootstart-end');
|
||||
};
|
||||
|
||||
module.exports = new RainLoopApp();
|
||||
module.exports = new AppApp();
|
||||
|
||||
}());
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
_ = require('_'),
|
||||
|
||||
Globals = require('Common/Globals'),
|
||||
Settings = require('Storage:Settings')
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
@ -78,6 +78,7 @@
|
|||
};
|
||||
|
||||
/**
|
||||
* @param {boolean=} bWrapIsHtml = false
|
||||
* @return {string}
|
||||
*/
|
||||
HtmlEditor.prototype.getData = function (bWrapIsHtml)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
*/
|
||||
function LinkBuilder()
|
||||
{
|
||||
var Settings = require('Storage:Settings');
|
||||
var Settings = require('Storage/Settings');
|
||||
|
||||
this.sBase = '#/';
|
||||
this.sServer = './?';
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
function Plugins()
|
||||
{
|
||||
this.oSettings = require('Storage:Settings');
|
||||
this.oSettings = require('Storage/Settings');
|
||||
this.oViewModelsHooks = {};
|
||||
this.oSimpleHooks = {};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@
|
|||
{
|
||||
oParams = Utils.simpleQueryParser(sQueryString);
|
||||
|
||||
require('App:Knoin').showScreenPopup(PopupComposeVoreModel, [Enums.ComposeType.Empty, null, [oEmailModel],
|
||||
require('Knoin/Knoin').showScreenPopup(PopupComposeVoreModel, [Enums.ComposeType.Empty, null, [oEmailModel],
|
||||
Utils.isUnd(oParams.subject) ? null : Utils.pString(oParams.subject),
|
||||
Utils.isUnd(oParams.body) ? null : Utils.plainToHtml(Utils.pString(oParams.body))
|
||||
]);
|
||||
|
|
|
|||
21
dev/Knoin/AbstractBoot.js
Normal file
21
dev/Knoin/AbstractBoot.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AbstractBoot()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AbstractBoot.prototype.bootstart = function ()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
module.exports = AbstractBoot;
|
||||
|
||||
}());
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* @param {?=} aViewModels = []
|
||||
* @constructor
|
||||
*/
|
||||
function KnoinAbstractScreen(sScreenName, aViewModels)
|
||||
function AbstractScreen(sScreenName, aViewModels)
|
||||
{
|
||||
this.sScreenName = sScreenName;
|
||||
this.aViewModels = Utils.isArray(aViewModels) ? aViewModels : [];
|
||||
|
|
@ -24,22 +24,22 @@
|
|||
/**
|
||||
* @type {Array}
|
||||
*/
|
||||
KnoinAbstractScreen.prototype.oCross = null;
|
||||
AbstractScreen.prototype.oCross = null;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
KnoinAbstractScreen.prototype.sScreenName = '';
|
||||
AbstractScreen.prototype.sScreenName = '';
|
||||
|
||||
/**
|
||||
* @type {Array}
|
||||
*/
|
||||
KnoinAbstractScreen.prototype.aViewModels = [];
|
||||
AbstractScreen.prototype.aViewModels = [];
|
||||
|
||||
/**
|
||||
* @return {Array}
|
||||
*/
|
||||
KnoinAbstractScreen.prototype.viewModels = function ()
|
||||
AbstractScreen.prototype.viewModels = function ()
|
||||
{
|
||||
return this.aViewModels;
|
||||
};
|
||||
|
|
@ -47,12 +47,12 @@
|
|||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
KnoinAbstractScreen.prototype.screenName = function ()
|
||||
AbstractScreen.prototype.screenName = function ()
|
||||
{
|
||||
return this.sScreenName;
|
||||
};
|
||||
|
||||
KnoinAbstractScreen.prototype.routes = function ()
|
||||
AbstractScreen.prototype.routes = function ()
|
||||
{
|
||||
return null;
|
||||
};
|
||||
|
|
@ -60,12 +60,12 @@
|
|||
/**
|
||||
* @return {?Object}
|
||||
*/
|
||||
KnoinAbstractScreen.prototype.__cross = function ()
|
||||
AbstractScreen.prototype.__cross = function ()
|
||||
{
|
||||
return this.oCross;
|
||||
};
|
||||
|
||||
KnoinAbstractScreen.prototype.__start = function ()
|
||||
AbstractScreen.prototype.__start = function ()
|
||||
{
|
||||
var
|
||||
aRoutes = this.routes(),
|
||||
|
|
@ -86,6 +86,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
module.exports = KnoinAbstractScreen;
|
||||
module.exports = AbstractScreen;
|
||||
|
||||
}());
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
* @param {string=} sPosition = ''
|
||||
* @param {string=} sTemplate = ''
|
||||
*/
|
||||
function KnoinAbstractViewModel(sPosition, sTemplate)
|
||||
function AbstractView(sPosition, sTemplate)
|
||||
{
|
||||
this.bDisabeCloseOnEsc = false;
|
||||
this.sPosition = Utils.pString(sPosition);
|
||||
|
|
@ -36,47 +36,47 @@
|
|||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
KnoinAbstractViewModel.prototype.bDisabeCloseOnEsc = false;
|
||||
AbstractView.prototype.bDisabeCloseOnEsc = false;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
KnoinAbstractViewModel.prototype.sPosition = '';
|
||||
AbstractView.prototype.sPosition = '';
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
KnoinAbstractViewModel.prototype.sTemplate = '';
|
||||
AbstractView.prototype.sTemplate = '';
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
KnoinAbstractViewModel.prototype.sDefaultKeyScope = Enums.KeyState.None;
|
||||
AbstractView.prototype.sDefaultKeyScope = Enums.KeyState.None;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
KnoinAbstractViewModel.prototype.sCurrentKeyScope = Enums.KeyState.None;
|
||||
AbstractView.prototype.sCurrentKeyScope = Enums.KeyState.None;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
KnoinAbstractViewModel.prototype.viewModelName = '';
|
||||
AbstractView.prototype.viewModelName = '';
|
||||
|
||||
/**
|
||||
* @type {Array}
|
||||
*/
|
||||
KnoinAbstractViewModel.prototype.viewModelNames = [];
|
||||
AbstractView.prototype.viewModelNames = [];
|
||||
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
KnoinAbstractViewModel.prototype.viewModelDom = null;
|
||||
AbstractView.prototype.viewModelDom = null;
|
||||
|
||||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
KnoinAbstractViewModel.prototype.viewModelTemplate = function ()
|
||||
AbstractView.prototype.viewModelTemplate = function ()
|
||||
{
|
||||
return this.sTemplate;
|
||||
};
|
||||
|
|
@ -84,26 +84,26 @@
|
|||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
KnoinAbstractViewModel.prototype.viewModelPosition = function ()
|
||||
AbstractView.prototype.viewModelPosition = function ()
|
||||
{
|
||||
return this.sPosition;
|
||||
};
|
||||
|
||||
KnoinAbstractViewModel.prototype.cancelCommand = function () {};
|
||||
KnoinAbstractViewModel.prototype.closeCommand = function () {};
|
||||
AbstractView.prototype.cancelCommand = function () {};
|
||||
AbstractView.prototype.closeCommand = function () {};
|
||||
|
||||
KnoinAbstractViewModel.prototype.storeAndSetKeyScope = function ()
|
||||
AbstractView.prototype.storeAndSetKeyScope = function ()
|
||||
{
|
||||
this.sCurrentKeyScope = Globals.keyScope();
|
||||
Globals.keyScope(this.sDefaultKeyScope);
|
||||
};
|
||||
|
||||
KnoinAbstractViewModel.prototype.restoreKeyScope = function ()
|
||||
AbstractView.prototype.restoreKeyScope = function ()
|
||||
{
|
||||
Globals.keyScope(this.sCurrentKeyScope);
|
||||
};
|
||||
|
||||
KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
|
||||
AbstractView.prototype.registerPopupKeyDown = function ()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
|
|
@ -125,6 +125,6 @@
|
|||
});
|
||||
};
|
||||
|
||||
module.exports = KnoinAbstractViewModel;
|
||||
module.exports = AbstractView;
|
||||
|
||||
}());
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function KnoinAbstractBoot()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
KnoinAbstractBoot.prototype.bootstart = function ()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
module.exports = KnoinAbstractBoot;
|
||||
|
||||
}());
|
||||
|
|
@ -353,7 +353,7 @@
|
|||
MessageModel.prototype.computeSenderEmail = function ()
|
||||
{
|
||||
var
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Data = require('Storage/App/Data'),
|
||||
sSent = Data.sentFolder(),
|
||||
sDraft = Data.draftFolder()
|
||||
;
|
||||
|
|
@ -432,7 +432,7 @@
|
|||
{
|
||||
var
|
||||
bResult = false,
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Data = require('Storage/App/Data'),
|
||||
iPriority = Enums.MessagePriority.Normal
|
||||
;
|
||||
|
||||
|
|
@ -1088,7 +1088,7 @@
|
|||
|
||||
this.body.data('rl-plain-raw', this.plainRaw);
|
||||
|
||||
var Data = require('Storage:RainLoop:Data');
|
||||
var Data = require('Storage/App/Data');
|
||||
if (Data.capaOpenPGP())
|
||||
{
|
||||
this.body.data('rl-plain-pgp-signed', !!this.isPgpSigned());
|
||||
|
|
@ -1101,7 +1101,7 @@
|
|||
|
||||
MessageModel.prototype.storePgpVerifyDataToDom = function ()
|
||||
{
|
||||
var Data = require('Storage:RainLoop:Data');
|
||||
var Data = require('Storage/App/Data');
|
||||
if (this.body && Data.capaOpenPGP())
|
||||
{
|
||||
this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus());
|
||||
|
|
@ -1118,7 +1118,7 @@
|
|||
|
||||
this.plainRaw = Utils.pString(this.body.data('rl-plain-raw'));
|
||||
|
||||
var Data = require('Storage:RainLoop:Data');
|
||||
var Data = require('Storage/App/Data');
|
||||
if (Data.capaOpenPGP())
|
||||
{
|
||||
this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed'));
|
||||
|
|
@ -1143,7 +1143,7 @@
|
|||
var
|
||||
aRes = [],
|
||||
mPgpMessage = null,
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Data = require('Storage/App/Data'),
|
||||
sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
|
||||
aPublicKeys = Data.findPublicKeysByEmail(sFrom),
|
||||
oValidKey = null,
|
||||
|
|
@ -1207,7 +1207,7 @@
|
|||
aRes = [],
|
||||
mPgpMessage = null,
|
||||
mPgpMessageDecrypted = null,
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Data = require('Storage/App/Data'),
|
||||
sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
|
||||
aPublicKey = Data.findPublicKeysByEmail(sFrom),
|
||||
oPrivateKey = Data.findSelfPrivateKey(sPassword),
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
(function (require) {
|
||||
'use strict';
|
||||
require('App:Boot')(require('App:RainLoop'));
|
||||
}(require));
|
||||
|
|
@ -12,18 +12,18 @@
|
|||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractScreen = require('Knoin:AbstractScreen')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractScreen = require('Knoin/AbstractScreen')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Array} aViewModels
|
||||
* @extends KnoinAbstractScreen
|
||||
* @extends AbstractScreen
|
||||
*/
|
||||
function AbstractSettingsScreen(aViewModels)
|
||||
{
|
||||
KnoinAbstractScreen.call(this, 'settings', aViewModels);
|
||||
AbstractScreen.call(this, 'settings', aViewModels);
|
||||
|
||||
this.menu = ko.observableArray([]);
|
||||
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
this.setupSettings();
|
||||
}
|
||||
|
||||
_.extend(AbstractSettingsScreen.prototype, KnoinAbstractScreen.prototype);
|
||||
_.extend(AbstractSettingsScreen.prototype, AbstractScreen.prototype);
|
||||
|
||||
/**
|
||||
* @param {Function=} fCallback
|
||||
32
dev/Screen/Admin/Login.js
Normal file
32
dev/Screen/Admin/Login.js
Normal 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;
|
||||
|
||||
}());
|
||||
79
dev/Screen/Admin/Settings.js
Normal file
79
dev/Screen/Admin/Settings.js
Normal 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
32
dev/Screen/App/About.js
Normal 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
32
dev/Screen/App/Login.js
Normal 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;
|
||||
|
||||
}());
|
||||
|
|
@ -11,49 +11,49 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Events = require('Common/Events'),
|
||||
|
||||
KnoinAbstractScreen = require('Knoin:AbstractScreen'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Cache = require('Storage/App/Cache'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Cache = require('Storage:RainLoop:Cache'),
|
||||
Remote = require('Storage:RainLoop:Remote')
|
||||
AbstractScreen = require('Knoin/AbstractScreen')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractScreen
|
||||
* @extends AbstractScreen
|
||||
*/
|
||||
function MailBoxScreen()
|
||||
function MailBoxAppScreen()
|
||||
{
|
||||
KnoinAbstractScreen.call(this, 'mailbox', [
|
||||
require('View:RainLoop:MailBoxSystemDropDown'),
|
||||
require('View:RainLoop:MailBoxFolderList'),
|
||||
require('View:RainLoop:MailBoxMessageList'),
|
||||
require('View:RainLoop:MailBoxMessageView')
|
||||
AbstractScreen.call(this, 'mailbox', [
|
||||
require('View/App/MailBox/SystemDropDown'),
|
||||
require('View/App/MailBox/FolderList'),
|
||||
require('View/App/MailBox/MessageList'),
|
||||
require('View/App/MailBox/MessageView')
|
||||
]);
|
||||
|
||||
this.oLastRoute = {};
|
||||
}
|
||||
|
||||
_.extend(MailBoxScreen.prototype, KnoinAbstractScreen.prototype);
|
||||
_.extend(MailBoxAppScreen.prototype, AbstractScreen.prototype);
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
MailBoxScreen.prototype.oLastRoute = {};
|
||||
MailBoxAppScreen.prototype.oLastRoute = {};
|
||||
|
||||
MailBoxScreen.prototype.setNewTitle = function ()
|
||||
MailBoxAppScreen.prototype.setNewTitle = function ()
|
||||
{
|
||||
var
|
||||
sEmail = Data.accountEmail(),
|
||||
nFoldersInboxUnreadCount = Data.foldersInboxUnreadCount()
|
||||
;
|
||||
|
||||
require('App:RainLoop').setTitle(('' === sEmail ? '' :
|
||||
require('App/App').setTitle(('' === sEmail ? '' :
|
||||
(0 < nFoldersInboxUnreadCount ? '(' + nFoldersInboxUnreadCount + ') ' : ' ') + sEmail + ' - ') + Utils.i18n('TITLES/MAILBOX'));
|
||||
};
|
||||
|
||||
MailBoxScreen.prototype.onShow = function ()
|
||||
MailBoxAppScreen.prototype.onShow = function ()
|
||||
{
|
||||
this.setNewTitle();
|
||||
Globals.keyScope(Enums.KeyState.MessageList);
|
||||
|
|
@ -65,13 +65,13 @@
|
|||
* @param {string} sSearch
|
||||
* @param {boolean=} bPreview = false
|
||||
*/
|
||||
MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPreview)
|
||||
MailBoxAppScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPreview)
|
||||
{
|
||||
if (Utils.isUnd(bPreview) ? false : !!bPreview)
|
||||
{
|
||||
if (Enums.Layout.NoPreview === Data.layout() && !Data.message())
|
||||
{
|
||||
require('App:RainLoop').historyBack();
|
||||
require('App/App').historyBack();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -94,12 +94,12 @@
|
|||
Data.message(null);
|
||||
}
|
||||
|
||||
require('App:RainLoop').reloadMessageList();
|
||||
require('App/App').reloadMessageList();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MailBoxScreen.prototype.onStart = function ()
|
||||
MailBoxAppScreen.prototype.onStart = function ()
|
||||
{
|
||||
var
|
||||
fResizeFunction = function () {
|
||||
|
|
@ -109,18 +109,18 @@
|
|||
|
||||
if (Settings.capa(Enums.Capa.AdditionalAccounts) || Settings.capa(Enums.Capa.AdditionalIdentities))
|
||||
{
|
||||
require('App:RainLoop').accountsAndIdentities();
|
||||
require('App/App').accountsAndIdentities();
|
||||
}
|
||||
|
||||
_.delay(function () {
|
||||
if ('INBOX' !== Data.currentFolderFullNameRaw())
|
||||
{
|
||||
require('App:RainLoop').folderInformation('INBOX');
|
||||
require('App/App').folderInformation('INBOX');
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
_.delay(function () {
|
||||
require('App:RainLoop').quota();
|
||||
require('App/App').quota();
|
||||
}, 5000);
|
||||
|
||||
_.delay(function () {
|
||||
|
|
@ -149,7 +149,7 @@
|
|||
/**
|
||||
* @return {Array}
|
||||
*/
|
||||
MailBoxScreen.prototype.routes = function ()
|
||||
MailBoxAppScreen.prototype.routes = function ()
|
||||
{
|
||||
var
|
||||
fNormP = function () {
|
||||
|
|
@ -191,6 +191,6 @@
|
|||
];
|
||||
};
|
||||
|
||||
module.exports = MailBoxScreen;
|
||||
module.exports = MailBoxAppScreen;
|
||||
|
||||
}());
|
||||
|
|
@ -10,23 +10,23 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Globals = require('Common/Globals'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Settings = require('Storage/Settings'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
||||
AbstractSettingsScreen = require('Screen:AbstractSettings')
|
||||
AbstractSettingsScreen = require('Screen/AbstractSettings')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractSettingsScreen
|
||||
*/
|
||||
function SettingsScreen()
|
||||
function SettingsAppScreen()
|
||||
{
|
||||
AbstractSettingsScreen.call(this, [
|
||||
require('View:RainLoop:SettingsSystemDropDown'),
|
||||
require('View:RainLoop:SettingsMenu'),
|
||||
require('View:RainLoop:SettingsPane')
|
||||
require('View/App/Settings/SystemDropDown'),
|
||||
require('View/App/Settings/Menu'),
|
||||
require('View/App/Settings/Pane')
|
||||
]);
|
||||
|
||||
Utils.initOnStartOrLangChange(function () {
|
||||
|
|
@ -36,48 +36,48 @@
|
|||
});
|
||||
}
|
||||
|
||||
_.extend(SettingsScreen.prototype, AbstractSettingsScreen.prototype);
|
||||
_.extend(SettingsAppScreen.prototype, AbstractSettingsScreen.prototype);
|
||||
|
||||
/**
|
||||
* @param {Function=} fCallback
|
||||
*/
|
||||
SettingsScreen.prototype.setupSettings = function (fCallback)
|
||||
SettingsAppScreen.prototype.setupSettings = function (fCallback)
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:General'),
|
||||
kn.addSettingsViewModel(require('Settings/App/General'),
|
||||
'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
||||
|
||||
if (Settings.settingsGet('ContactsIsAllowed'))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:Contacts'),
|
||||
kn.addSettingsViewModel(require('Settings/App/Contacts'),
|
||||
'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.AdditionalAccounts))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:Accounts'),
|
||||
kn.addSettingsViewModel(require('Settings/App/Accounts'),
|
||||
'SettingsAccounts', 'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME', 'accounts');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.AdditionalIdentities))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:Identities'),
|
||||
kn.addSettingsViewModel(require('Settings/App/Identities'),
|
||||
'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities');
|
||||
}
|
||||
else
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:Identity'),
|
||||
kn.addSettingsViewModel(require('Settings/App/Identity'),
|
||||
'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.Filters))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:Filters'),
|
||||
kn.addSettingsViewModel(require('Settings/App/Filters'),
|
||||
'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.TwoFactor))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:Security'),
|
||||
kn.addSettingsViewModel(require('Settings/App/Security'),
|
||||
'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
|
||||
}
|
||||
|
||||
|
|
@ -85,28 +85,28 @@
|
|||
Settings.settingsGet('AllowFacebookSocial') ||
|
||||
Settings.settingsGet('AllowTwitterSocial'))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:Social'),
|
||||
kn.addSettingsViewModel(require('Settings/App/Social'),
|
||||
'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
|
||||
}
|
||||
|
||||
if (Settings.settingsGet('ChangePasswordIsAllowed'))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:ChangePassword'),
|
||||
kn.addSettingsViewModel(require('Settings/App/ChangePassword'),
|
||||
'SettingsChangePassword', 'SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME', 'change-password');
|
||||
}
|
||||
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:Folders'),
|
||||
kn.addSettingsViewModel(require('Settings/App/Folders'),
|
||||
'SettingsFolders', 'SETTINGS_LABELS/LABEL_FOLDERS_NAME', 'folders');
|
||||
|
||||
if (Settings.capa(Enums.Capa.Themes))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:Themes'),
|
||||
kn.addSettingsViewModel(require('Settings/App/Themes'),
|
||||
'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes');
|
||||
}
|
||||
|
||||
if (Settings.capa(Enums.Capa.OpenPGP))
|
||||
{
|
||||
kn.addSettingsViewModel(require('Settings:RainLoop:OpenPGP'),
|
||||
kn.addSettingsViewModel(require('Settings/App/OpenPGP'),
|
||||
'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp');
|
||||
}
|
||||
|
||||
|
|
@ -116,17 +116,17 @@
|
|||
}
|
||||
};
|
||||
|
||||
SettingsScreen.prototype.onShow = function ()
|
||||
SettingsAppScreen.prototype.onShow = function ()
|
||||
{
|
||||
this.setSettingsTitle();
|
||||
Globals.keyScope(Enums.KeyState.Settings);
|
||||
};
|
||||
|
||||
SettingsScreen.prototype.setSettingsTitle = function ()
|
||||
SettingsAppScreen.prototype.setSettingsTitle = function ()
|
||||
{
|
||||
require('App:RainLoop').setTitle(this.sSettingsTitle);
|
||||
require('App/App').setTitle(this.sSettingsTitle);
|
||||
};
|
||||
|
||||
module.exports = SettingsScreen;
|
||||
module.exports = SettingsAppScreen;
|
||||
|
||||
}());
|
||||
|
|
@ -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;
|
||||
|
||||
}());
|
||||
|
|
@ -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;
|
||||
|
||||
}());
|
||||
|
|
@ -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;
|
||||
|
||||
}());
|
||||
|
|
@ -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;
|
||||
|
||||
}());
|
||||
|
|
@ -10,11 +10,11 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminSettingsAbout()
|
||||
function AboutAdminSetting()
|
||||
{
|
||||
var
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:Admin:Data')
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data')
|
||||
;
|
||||
|
||||
this.version = ko.observable(Settings.settingsGet('Version'));
|
||||
|
|
@ -67,22 +67,22 @@
|
|||
}, this);
|
||||
}
|
||||
|
||||
AdminSettingsAbout.prototype.onBuild = function ()
|
||||
AboutAdminSetting.prototype.onBuild = function ()
|
||||
{
|
||||
if (this.access())
|
||||
{
|
||||
require('App:Admin').reloadCoreData();
|
||||
require('App/Admin').reloadCoreData();
|
||||
}
|
||||
};
|
||||
|
||||
AdminSettingsAbout.prototype.updateCoreData = function ()
|
||||
AboutAdminSetting.prototype.updateCoreData = function ()
|
||||
{
|
||||
if (!this.coreUpdating())
|
||||
{
|
||||
require('App:Admin').updateCoreData();
|
||||
require('App/Admin').updateCoreData();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = AdminSettingsAbout;
|
||||
module.exports = AboutAdminSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -13,11 +13,11 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminSettingsBranding()
|
||||
function BrandingAdminSetting()
|
||||
{
|
||||
var
|
||||
Enums = require('Common/Enums'),
|
||||
Settings = require('Storage:Settings')
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
this.title = ko.observable(Settings.settingsGet('Title'));
|
||||
|
|
@ -36,11 +36,11 @@
|
|||
this.loginCss.trigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
}
|
||||
|
||||
AdminSettingsBranding.prototype.onBuild = function ()
|
||||
BrandingAdminSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
Remote = require('Storage:Admin:Remote')
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
_.delay(function () {
|
||||
|
|
@ -86,6 +86,6 @@
|
|||
}, 50);
|
||||
};
|
||||
|
||||
module.exports = AdminSettingsBranding;
|
||||
module.exports = BrandingAdminSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -10,16 +10,16 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage:Settings')
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminSettingsContacts()
|
||||
function ContactsAdminSetting()
|
||||
{
|
||||
var
|
||||
Remote = require('Storage:Admin:Remote')
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
|
||||
|
|
@ -141,7 +141,7 @@
|
|||
this.onTestContactsResponse = _.bind(this.onTestContactsResponse, this);
|
||||
}
|
||||
|
||||
AdminSettingsContacts.prototype.onTestContactsResponse = function (sResult, oData)
|
||||
ContactsAdminSetting.prototype.onTestContactsResponse = function (sResult, oData)
|
||||
{
|
||||
this.testContactsSuccess(false);
|
||||
this.testContactsError(false);
|
||||
|
|
@ -167,18 +167,18 @@
|
|||
this.testing(false);
|
||||
};
|
||||
|
||||
AdminSettingsContacts.prototype.onShow = function ()
|
||||
ContactsAdminSetting.prototype.onShow = function ()
|
||||
{
|
||||
this.testContactsSuccess(false);
|
||||
this.testContactsError(false);
|
||||
this.testContactsErrorMessage('');
|
||||
};
|
||||
|
||||
AdminSettingsContacts.prototype.onBuild = function ()
|
||||
ContactsAdminSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
Remote = require('Storage:Admin:Remote')
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
_.delay(function () {
|
||||
|
|
@ -237,6 +237,6 @@
|
|||
}, 50);
|
||||
};
|
||||
|
||||
module.exports = AdminSettingsContacts;
|
||||
module.exports = ContactsAdminSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -10,16 +10,16 @@
|
|||
|
||||
Enums = require('Common/Enums'),
|
||||
|
||||
PopupsDomainViewModel = require('View:Popup:Domain'),
|
||||
PopupsDomainViewModel = require('View/Popup/Domain'),
|
||||
|
||||
Data = require('Storage:Admin:Data'),
|
||||
Remote = require('Storage:Admin:Remote')
|
||||
Data = require('Storage/Admin/Data'),
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminSettingsDomains()
|
||||
function DomainsAdminSetting()
|
||||
{
|
||||
this.domains = Data.domains;
|
||||
this.domainsLoading = Data.domainsLoading;
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
]});
|
||||
}
|
||||
|
||||
AdminSettingsDomains.prototype.startDomainForDeletionTimeout = function ()
|
||||
DomainsAdminSetting.prototype.startDomainForDeletionTimeout = function ()
|
||||
{
|
||||
var self = this;
|
||||
window.clearInterval(this.iDomainForDeletionTimeout);
|
||||
|
|
@ -55,24 +55,24 @@
|
|||
}, 1000 * 3);
|
||||
};
|
||||
|
||||
AdminSettingsDomains.prototype.createDomain = function ()
|
||||
DomainsAdminSetting.prototype.createDomain = function ()
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(PopupsDomainViewModel);
|
||||
require('Knoin/Knoin').showScreenPopup(PopupsDomainViewModel);
|
||||
};
|
||||
|
||||
AdminSettingsDomains.prototype.deleteDomain = function (oDomain)
|
||||
DomainsAdminSetting.prototype.deleteDomain = function (oDomain)
|
||||
{
|
||||
this.domains.remove(oDomain);
|
||||
Remote.domainDelete(_.bind(this.onDomainListChangeRequest, this), oDomain.name);
|
||||
};
|
||||
|
||||
AdminSettingsDomains.prototype.disableDomain = function (oDomain)
|
||||
DomainsAdminSetting.prototype.disableDomain = function (oDomain)
|
||||
{
|
||||
oDomain.disabled(!oDomain.disabled());
|
||||
Remote.domainDisable(_.bind(this.onDomainListChangeRequest, this), oDomain.name, oDomain.disabled());
|
||||
};
|
||||
|
||||
AdminSettingsDomains.prototype.onBuild = function (oDom)
|
||||
DomainsAdminSetting.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var self = this;
|
||||
oDom
|
||||
|
|
@ -85,22 +85,22 @@
|
|||
})
|
||||
;
|
||||
|
||||
require('App:Admin').reloadDomainList();
|
||||
require('App/Admin').reloadDomainList();
|
||||
};
|
||||
|
||||
AdminSettingsDomains.prototype.onDomainLoadRequest = function (sResult, oData)
|
||||
DomainsAdminSetting.prototype.onDomainLoadRequest = function (sResult, oData)
|
||||
{
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(PopupsDomainViewModel, [oData.Result]);
|
||||
require('Knoin/Knoin').showScreenPopup(PopupsDomainViewModel, [oData.Result]);
|
||||
}
|
||||
};
|
||||
|
||||
AdminSettingsDomains.prototype.onDomainListChangeRequest = function ()
|
||||
DomainsAdminSetting.prototype.onDomainListChangeRequest = function ()
|
||||
{
|
||||
require('App:Admin').reloadDomainList();
|
||||
require('App/Admin').reloadDomainList();
|
||||
};
|
||||
|
||||
module.exports = AdminSettingsDomains;
|
||||
module.exports = DomainsAdminSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -11,14 +11,14 @@
|
|||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:Admin:Data')
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminSettingsGeneral()
|
||||
function GeneralAdminSetting()
|
||||
{
|
||||
this.mainLanguage = Data.mainLanguage;
|
||||
this.mainTheme = Data.mainTheme;
|
||||
|
|
@ -61,11 +61,11 @@
|
|||
this.themeTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
}
|
||||
|
||||
AdminSettingsGeneral.prototype.onBuild = function ()
|
||||
GeneralAdminSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
Remote = require('Storage:Admin:Remote')
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
_.delay(function () {
|
||||
|
|
@ -127,19 +127,19 @@
|
|||
}, 50);
|
||||
};
|
||||
|
||||
AdminSettingsGeneral.prototype.selectLanguage = function ()
|
||||
GeneralAdminSetting.prototype.selectLanguage = function ()
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:Languages'));
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Languages'));
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
AdminSettingsGeneral.prototype.phpInfoLink = function ()
|
||||
GeneralAdminSetting.prototype.phpInfoLink = function ()
|
||||
{
|
||||
return LinkBuilder.phpInfo();
|
||||
};
|
||||
|
||||
module.exports = AdminSettingsGeneral;
|
||||
module.exports = GeneralAdminSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -7,14 +7,14 @@
|
|||
ko = require('ko'),
|
||||
moment = require('moment'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:Admin:Data')
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminSettingsLicensing()
|
||||
function LicensingAdminSetting()
|
||||
{
|
||||
this.licensing = Data.licensing;
|
||||
this.licensingProcess = Data.licensingProcess;
|
||||
|
|
@ -29,33 +29,33 @@
|
|||
this.licenseTrigger.subscribe(function () {
|
||||
if (this.subscriptionEnabled())
|
||||
{
|
||||
require('App:Admin').reloadLicensing(true);
|
||||
require('App/Admin').reloadLicensing(true);
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
AdminSettingsLicensing.prototype.onBuild = function ()
|
||||
LicensingAdminSetting.prototype.onBuild = function ()
|
||||
{
|
||||
if (this.subscriptionEnabled())
|
||||
{
|
||||
require('App:Admin').reloadLicensing(false);
|
||||
require('App/Admin').reloadLicensing(false);
|
||||
}
|
||||
};
|
||||
|
||||
AdminSettingsLicensing.prototype.onShow = function ()
|
||||
LicensingAdminSetting.prototype.onShow = function ()
|
||||
{
|
||||
this.adminDomain(Settings.settingsGet('AdminDomain'));
|
||||
};
|
||||
|
||||
AdminSettingsLicensing.prototype.showActivationForm = function ()
|
||||
LicensingAdminSetting.prototype.showActivationForm = function ()
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:Activate'));
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Activate'));
|
||||
};
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
AdminSettingsLicensing.prototype.licenseExpiredMomentValue = function ()
|
||||
LicensingAdminSetting.prototype.licenseExpiredMomentValue = function ()
|
||||
{
|
||||
var
|
||||
iTime = this.licenseExpired(),
|
||||
|
|
@ -65,6 +65,6 @@
|
|||
return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')');
|
||||
};
|
||||
|
||||
module.exports = AdminSettingsLicensing;
|
||||
module.exports = LicensingAdminSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -10,14 +10,14 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:Admin:Data')
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminSettingsLogin()
|
||||
function LoginAdminSetting()
|
||||
{
|
||||
this.determineUserLanguage = Data.determineUserLanguage;
|
||||
this.determineUserDomain = Data.determineUserDomain;
|
||||
|
|
@ -28,11 +28,11 @@
|
|||
this.defaultDomainTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
}
|
||||
|
||||
AdminSettingsLogin.prototype.onBuild = function ()
|
||||
LoginAdminSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
Remote = require('Storage:Admin:Remote')
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
_.delay(function () {
|
||||
|
|
@ -66,6 +66,6 @@
|
|||
}, 50);
|
||||
};
|
||||
|
||||
module.exports = AdminSettingsLogin;
|
||||
module.exports = LoginAdminSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -10,14 +10,14 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Data = require('Storage:Admin:Data'),
|
||||
Remote = require('Storage:Admin:Remote')
|
||||
Data = require('Storage/Admin/Data'),
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminSettingsPackages()
|
||||
function PackagesAdminSetting()
|
||||
{
|
||||
this.packagesError = ko.observable('');
|
||||
|
||||
|
|
@ -43,17 +43,17 @@
|
|||
}, this);
|
||||
}
|
||||
|
||||
AdminSettingsPackages.prototype.onShow = function ()
|
||||
PackagesAdminSetting.prototype.onShow = function ()
|
||||
{
|
||||
this.packagesError('');
|
||||
};
|
||||
|
||||
AdminSettingsPackages.prototype.onBuild = function ()
|
||||
PackagesAdminSetting.prototype.onBuild = function ()
|
||||
{
|
||||
require('App:Admin').reloadPackagesList();
|
||||
require('App/Admin').reloadPackagesList();
|
||||
};
|
||||
|
||||
AdminSettingsPackages.prototype.requestHelper = function (oPackage, bInstall)
|
||||
PackagesAdminSetting.prototype.requestHelper = function (oPackage, bInstall)
|
||||
{
|
||||
var self = this;
|
||||
return function (sResult, oData) {
|
||||
|
|
@ -85,12 +85,12 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
require('App:Admin').reloadPackagesList();
|
||||
require('App/Admin').reloadPackagesList();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
AdminSettingsPackages.prototype.deletePackage = function (oPackage)
|
||||
PackagesAdminSetting.prototype.deletePackage = function (oPackage)
|
||||
{
|
||||
if (oPackage)
|
||||
{
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
AdminSettingsPackages.prototype.installPackage = function (oPackage)
|
||||
PackagesAdminSetting.prototype.installPackage = function (oPackage)
|
||||
{
|
||||
if (oPackage)
|
||||
{
|
||||
|
|
@ -108,6 +108,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
module.exports = AdminSettingsPackages;
|
||||
module.exports = PackagesAdminSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -10,15 +10,15 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:Admin:Data'),
|
||||
Remote = require('Storage:Admin:Remote')
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data'),
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminSettingsPlugins()
|
||||
function PluginsAdminSetting()
|
||||
{
|
||||
this.enabledPlugins = ko.observable(!!Settings.settingsGet('EnabledPlugins'));
|
||||
|
||||
|
|
@ -35,18 +35,18 @@
|
|||
this.onPluginDisableRequest = _.bind(this.onPluginDisableRequest, this);
|
||||
}
|
||||
|
||||
AdminSettingsPlugins.prototype.disablePlugin = function (oPlugin)
|
||||
PluginsAdminSetting.prototype.disablePlugin = function (oPlugin)
|
||||
{
|
||||
oPlugin.disabled(!oPlugin.disabled());
|
||||
Remote.pluginDisable(this.onPluginDisableRequest, oPlugin.name, oPlugin.disabled());
|
||||
};
|
||||
|
||||
AdminSettingsPlugins.prototype.configurePlugin = function (oPlugin)
|
||||
PluginsAdminSetting.prototype.configurePlugin = function (oPlugin)
|
||||
{
|
||||
Remote.plugin(this.onPluginLoadRequest, oPlugin.name);
|
||||
};
|
||||
|
||||
AdminSettingsPlugins.prototype.onBuild = function (oDom)
|
||||
PluginsAdminSetting.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var self = this;
|
||||
|
||||
|
|
@ -74,21 +74,21 @@
|
|||
});
|
||||
};
|
||||
|
||||
AdminSettingsPlugins.prototype.onShow = function ()
|
||||
PluginsAdminSetting.prototype.onShow = function ()
|
||||
{
|
||||
this.pluginsError('');
|
||||
require('App:Admin').reloadPluginList();
|
||||
require('App/Admin').reloadPluginList();
|
||||
};
|
||||
|
||||
AdminSettingsPlugins.prototype.onPluginLoadRequest = function (sResult, oData)
|
||||
PluginsAdminSetting.prototype.onPluginLoadRequest = function (sResult, oData)
|
||||
{
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:Plugin'), [oData.Result]);
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Plugin'), [oData.Result]);
|
||||
}
|
||||
};
|
||||
|
||||
AdminSettingsPlugins.prototype.onPluginDisableRequest = function (sResult, oData)
|
||||
PluginsAdminSetting.prototype.onPluginDisableRequest = function (sResult, oData)
|
||||
{
|
||||
if (Enums.StorageResultType.Success === sResult && oData)
|
||||
{
|
||||
|
|
@ -105,9 +105,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
require('App:Admin').reloadPluginList();
|
||||
require('App/Admin').reloadPluginList();
|
||||
};
|
||||
|
||||
module.exports = AdminSettingsPlugins;
|
||||
module.exports = PluginsAdminSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -11,15 +11,15 @@
|
|||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:Admin:Data'),
|
||||
Remote = require('Storage:Admin:Remote')
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data'),
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminSettingsSecurity()
|
||||
function SecurityAdminSetting()
|
||||
{
|
||||
this.useLocalProxyForExternalImages = Data.useLocalProxyForExternalImages;
|
||||
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
this.onNewAdminPasswordResponse = _.bind(this.onNewAdminPasswordResponse, this);
|
||||
}
|
||||
|
||||
AdminSettingsSecurity.prototype.onNewAdminPasswordResponse = function (sResult, oData)
|
||||
SecurityAdminSetting.prototype.onNewAdminPasswordResponse = function (sResult, oData)
|
||||
{
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
|
|
@ -91,10 +91,10 @@
|
|||
}
|
||||
};
|
||||
|
||||
AdminSettingsSecurity.prototype.onBuild = function ()
|
||||
SecurityAdminSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var
|
||||
Remote = require('Storage:Admin:Remote')
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
this.capaOpenPGP.subscribe(function (bValue) {
|
||||
|
|
@ -116,7 +116,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
AdminSettingsSecurity.prototype.onHide = function ()
|
||||
SecurityAdminSetting.prototype.onHide = function ()
|
||||
{
|
||||
this.adminPassword('');
|
||||
this.adminPasswordNew('');
|
||||
|
|
@ -126,11 +126,11 @@
|
|||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
AdminSettingsSecurity.prototype.phpInfoLink = function ()
|
||||
SecurityAdminSetting.prototype.phpInfoLink = function ()
|
||||
{
|
||||
return LinkBuilder.phpInfo();
|
||||
};
|
||||
|
||||
module.exports = AdminSettingsSecurity;
|
||||
module.exports = SecurityAdminSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -14,14 +14,15 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AdminSettingsSocial()
|
||||
function SocialAdminSetting()
|
||||
{
|
||||
var Data = require('Storage:Admin:Data');
|
||||
var Data = require('Storage/Admin/Data');
|
||||
|
||||
this.googleEnable = Data.googleEnable;
|
||||
this.googleClientID = Data.googleClientID;
|
||||
this.googleApiKey = Data.googleApiKey;
|
||||
this.googleClientSecret = Data.googleClientSecret;
|
||||
|
||||
this.googleTrigger1 = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.googleTrigger2 = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.googleTrigger3 = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
|
|
@ -44,11 +45,11 @@
|
|||
this.dropboxTrigger1 = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
}
|
||||
|
||||
AdminSettingsSocial.prototype.onBuild = function ()
|
||||
SocialAdminSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
Remote = require('Storage:Admin:Remote')
|
||||
Remote = require('Storage/Admin/Remote')
|
||||
;
|
||||
|
||||
_.delay(function () {
|
||||
|
|
@ -148,6 +149,6 @@
|
|||
}, 50);
|
||||
};
|
||||
|
||||
module.exports = AdminSettingsSocial;
|
||||
module.exports = SocialAdminSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -12,14 +12,14 @@
|
|||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote')
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsAccounts()
|
||||
function AccountsAppSetting()
|
||||
{
|
||||
this.accounts = Data.accounts;
|
||||
|
||||
|
|
@ -46,22 +46,22 @@
|
|||
]});
|
||||
}
|
||||
|
||||
SettingsAccounts.prototype.addNewAccount = function ()
|
||||
AccountsAppSetting.prototype.addNewAccount = function ()
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:AddAccount'));
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount'));
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {AccountModel} oAccountToRemove
|
||||
*/
|
||||
SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove)
|
||||
AccountsAppSetting.prototype.deleteAccount = function (oAccountToRemove)
|
||||
{
|
||||
if (oAccountToRemove && oAccountToRemove.deleteAccess())
|
||||
{
|
||||
this.accountForDeletion(null);
|
||||
|
||||
var
|
||||
kn = require('App:Knoin'),
|
||||
kn = require('Knoin/Knoin'),
|
||||
fRemoveAccount = function (oAccount) {
|
||||
return oAccountToRemove === oAccount;
|
||||
}
|
||||
|
|
@ -86,7 +86,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
require('App:RainLoop').accountsAndIdentities();
|
||||
require('App/App').accountsAndIdentities();
|
||||
}
|
||||
|
||||
}, oAccountToRemove.email);
|
||||
|
|
@ -94,6 +94,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
module.exports = SettingsAccounts;
|
||||
module.exports = AccountsAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -10,13 +10,13 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Remote = require('Storage:RainLoop:Remote')
|
||||
Remote = require('Storage/App/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsChangePassword()
|
||||
function ChangePasswordAppSetting()
|
||||
{
|
||||
this.changeProcess = ko.observable(false);
|
||||
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
this.onChangePasswordResponse = _.bind(this.onChangePasswordResponse, this);
|
||||
}
|
||||
|
||||
SettingsChangePassword.prototype.onHide = function ()
|
||||
ChangePasswordAppSetting.prototype.onHide = function ()
|
||||
{
|
||||
this.changeProcess(false);
|
||||
this.currentPassword('');
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
this.currentPassword.error(false);
|
||||
};
|
||||
|
||||
SettingsChangePassword.prototype.onChangePasswordResponse = function (sResult, oData)
|
||||
ChangePasswordAppSetting.prototype.onChangePasswordResponse = function (sResult, oData)
|
||||
{
|
||||
this.changeProcess(false);
|
||||
this.passwordMismatch(false);
|
||||
|
|
@ -116,6 +116,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
module.exports = SettingsChangePassword;
|
||||
module.exports = ChangePasswordAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -6,16 +6,14 @@
|
|||
var
|
||||
ko = require('ko'),
|
||||
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Data = require('Storage:RainLoop:Data')
|
||||
Remote = require('Storage/App/Remote'),
|
||||
Data = require('Storage/App/Data')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsContacts()
|
||||
function ContactsAppSetting()
|
||||
{
|
||||
this.contactsAutosave = Data.contactsAutosave;
|
||||
|
||||
|
|
@ -44,7 +42,7 @@
|
|||
}, this);
|
||||
}
|
||||
|
||||
SettingsContacts.prototype.onBuild = function ()
|
||||
ContactsAppSetting.prototype.onBuild = function ()
|
||||
{
|
||||
Data.contactsAutosave.subscribe(function (bValue) {
|
||||
Remote.saveSettings(null, {
|
||||
|
|
@ -53,6 +51,6 @@
|
|||
});
|
||||
};
|
||||
|
||||
module.exports = SettingsContacts;
|
||||
module.exports = ContactsAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsFilters()
|
||||
function FiltersAppSetting()
|
||||
{
|
||||
this.filters = ko.observableArray([]);
|
||||
this.filters.loading = ko.observable(false);
|
||||
|
|
@ -22,21 +22,21 @@
|
|||
});
|
||||
}
|
||||
|
||||
SettingsFilters.prototype.deleteFilter = function (oFilter)
|
||||
FiltersAppSetting.prototype.deleteFilter = function (oFilter)
|
||||
{
|
||||
this.filters.remove(oFilter);
|
||||
};
|
||||
|
||||
SettingsFilters.prototype.addFilter = function ()
|
||||
FiltersAppSetting.prototype.addFilter = function ()
|
||||
{
|
||||
var
|
||||
FilterModel = require('Model/Filter')
|
||||
;
|
||||
|
||||
require('App:Knoin').showScreenPopup(
|
||||
require('View:Popup:Filter'), [new FilterModel()]);
|
||||
require('Knoin/Knoin').showScreenPopup(
|
||||
require('View/Popup/Filter'), [new FilterModel()]);
|
||||
};
|
||||
|
||||
module.exports = SettingsFilters;
|
||||
module.exports = FiltersAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -9,17 +9,17 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Cache = require('Storage:RainLoop:Cache'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
LocalStorage = require('Storage:LocalStorage')
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Cache = require('Storage/App/Cache'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
Local = require('Storage/Local')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsFolders()
|
||||
function FoldersAppSetting()
|
||||
{
|
||||
this.foldersListError = Data.foldersListError;
|
||||
this.folderList = Data.folderList;
|
||||
|
|
@ -89,7 +89,7 @@
|
|||
this.useImapSubscribe = !!Settings.settingsGet('UseImapSubscribe');
|
||||
}
|
||||
|
||||
SettingsFolders.prototype.folderEditOnEnter = function (oFolder)
|
||||
FoldersAppSetting.prototype.folderEditOnEnter = function (oFolder)
|
||||
{
|
||||
var
|
||||
sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : ''
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
if ('' !== sEditName && oFolder.name() !== sEditName)
|
||||
{
|
||||
LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||
|
||||
Data.foldersRenaming(true);
|
||||
Remote.folderRename(function (sResult, oData) {
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_RENAME_FOLDER'));
|
||||
}
|
||||
|
||||
require('App:RainLoop').folders();
|
||||
require('App/App').folders();
|
||||
|
||||
}, oFolder.fullNameRaw, sEditName);
|
||||
|
||||
|
|
@ -121,7 +121,7 @@
|
|||
oFolder.edited(false);
|
||||
};
|
||||
|
||||
SettingsFolders.prototype.folderEditOnEsc = function (oFolder)
|
||||
FoldersAppSetting.prototype.folderEditOnEsc = function (oFolder)
|
||||
{
|
||||
if (oFolder)
|
||||
{
|
||||
|
|
@ -129,22 +129,22 @@
|
|||
}
|
||||
};
|
||||
|
||||
SettingsFolders.prototype.onShow = function ()
|
||||
FoldersAppSetting.prototype.onShow = function ()
|
||||
{
|
||||
Data.foldersListError('');
|
||||
};
|
||||
|
||||
SettingsFolders.prototype.createFolder = function ()
|
||||
FoldersAppSetting.prototype.createFolder = function ()
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:FolderCreate'));
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderCreate'));
|
||||
};
|
||||
|
||||
SettingsFolders.prototype.systemFolder = function ()
|
||||
FoldersAppSetting.prototype.systemFolder = function ()
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:FolderSystem'));
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderSystem'));
|
||||
};
|
||||
|
||||
SettingsFolders.prototype.deleteFolder = function (oFolderToRemove)
|
||||
FoldersAppSetting.prototype.deleteFolder = function (oFolderToRemove)
|
||||
{
|
||||
if (oFolderToRemove && oFolderToRemove.canBeDeleted() && oFolderToRemove.deleteAccess() &&
|
||||
0 === oFolderToRemove.privateMessageCountAll())
|
||||
|
|
@ -166,7 +166,7 @@
|
|||
|
||||
if (oFolderToRemove)
|
||||
{
|
||||
LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||
|
||||
Data.folderList.remove(fRemoveFolder);
|
||||
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_DELETE_FOLDER'));
|
||||
}
|
||||
|
||||
require('App:RainLoop').folders();
|
||||
require('App/App').folders();
|
||||
|
||||
}, oFolderToRemove.fullNameRaw);
|
||||
|
||||
|
|
@ -193,22 +193,22 @@
|
|||
}
|
||||
};
|
||||
|
||||
SettingsFolders.prototype.subscribeFolder = function (oFolder)
|
||||
FoldersAppSetting.prototype.subscribeFolder = function (oFolder)
|
||||
{
|
||||
LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||
Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, true);
|
||||
|
||||
oFolder.subScribed(true);
|
||||
};
|
||||
|
||||
SettingsFolders.prototype.unSubscribeFolder = function (oFolder)
|
||||
FoldersAppSetting.prototype.unSubscribeFolder = function (oFolder)
|
||||
{
|
||||
LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||
Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, false);
|
||||
|
||||
oFolder.subScribed(false);
|
||||
};
|
||||
|
||||
module.exports = SettingsFolders;
|
||||
module.exports = FoldersAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -5,23 +5,21 @@
|
|||
|
||||
var
|
||||
_ = require('_'),
|
||||
$ = require('$'),
|
||||
ko = require('ko'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Consts = require('Common/Consts'),
|
||||
Globals = require('Common/Globals'),
|
||||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote')
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsGeneral()
|
||||
function GeneralAppSetting()
|
||||
{
|
||||
this.mainLanguage = Data.mainLanguage;
|
||||
this.mainMessagesPerPage = Data.mainMessagesPerPage;
|
||||
|
|
@ -57,12 +55,12 @@
|
|||
this.isAnimationSupported = Globals.bAnimationSupported;
|
||||
}
|
||||
|
||||
SettingsGeneral.prototype.toggleLayout = function ()
|
||||
GeneralAppSetting.prototype.toggleLayout = function ()
|
||||
{
|
||||
this.layout(Enums.Layout.NoPreview === this.layout() ? Enums.Layout.SidePreview : Enums.Layout.NoPreview);
|
||||
};
|
||||
|
||||
SettingsGeneral.prototype.onBuild = function ()
|
||||
GeneralAppSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
|
|
@ -158,16 +156,16 @@
|
|||
}, 50);
|
||||
};
|
||||
|
||||
SettingsGeneral.prototype.onShow = function ()
|
||||
GeneralAppSetting.prototype.onShow = function ()
|
||||
{
|
||||
Data.desktopNotifications.valueHasMutated();
|
||||
};
|
||||
|
||||
SettingsGeneral.prototype.selectLanguage = function ()
|
||||
GeneralAppSetting.prototype.selectLanguage = function ()
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:Languages'));
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Languages'));
|
||||
};
|
||||
|
||||
module.exports = SettingsGeneral;
|
||||
module.exports = GeneralAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -11,14 +11,14 @@
|
|||
Utils = require('Common/Utils'),
|
||||
HtmlEditor = require('Common/HtmlEditor'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote')
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsIdentities()
|
||||
function IdentitiesAppSetting()
|
||||
{
|
||||
this.editor = null;
|
||||
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
*
|
||||
* @return {string}
|
||||
*/
|
||||
SettingsIdentities.prototype.formattedAccountIdentity = function ()
|
||||
IdentitiesAppSetting.prototype.formattedAccountIdentity = function ()
|
||||
{
|
||||
var
|
||||
sDisplayName = this.displayName.peek(),
|
||||
|
|
@ -110,20 +110,20 @@
|
|||
return '' === sDisplayName ? sEmail : '"' + Utils.quoteName(sDisplayName) + '" <' + sEmail + '>';
|
||||
};
|
||||
|
||||
SettingsIdentities.prototype.addNewIdentity = function ()
|
||||
IdentitiesAppSetting.prototype.addNewIdentity = function ()
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:Identity'));
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'));
|
||||
};
|
||||
|
||||
SettingsIdentities.prototype.editIdentity = function (oIdentity)
|
||||
IdentitiesAppSetting.prototype.editIdentity = function (oIdentity)
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:Identity'), [oIdentity]);
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'), [oIdentity]);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {IdentityModel} oIdentityToRemove
|
||||
*/
|
||||
SettingsIdentities.prototype.deleteIdentity = function (oIdentityToRemove)
|
||||
IdentitiesAppSetting.prototype.deleteIdentity = function (oIdentityToRemove)
|
||||
{
|
||||
if (oIdentityToRemove && oIdentityToRemove.deleteAccess())
|
||||
{
|
||||
|
|
@ -140,13 +140,13 @@
|
|||
this.identities.remove(fRemoveFolder);
|
||||
|
||||
Remote.identityDelete(function () {
|
||||
require('App:RainLoop').accountsAndIdentities();
|
||||
require('App/App').accountsAndIdentities();
|
||||
}, oIdentityToRemove.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
SettingsIdentities.prototype.onFocus = function ()
|
||||
IdentitiesAppSetting.prototype.onFocus = function ()
|
||||
{
|
||||
if (!this.editor && this.signatureDom())
|
||||
{
|
||||
|
|
@ -172,7 +172,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
SettingsIdentities.prototype.onBuild = function (oDom)
|
||||
IdentitiesAppSetting.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var self = this;
|
||||
|
||||
|
|
@ -228,6 +228,6 @@
|
|||
}, 50);
|
||||
};
|
||||
|
||||
module.exports = SettingsIdentities;
|
||||
module.exports = IdentitiesAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -11,14 +11,14 @@
|
|||
Utils = require('Common/Utils'),
|
||||
HtmlEditor = require('Common/HtmlEditor'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote')
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsIdentity()
|
||||
function IdentityAppSetting()
|
||||
{
|
||||
this.editor = null;
|
||||
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
}
|
||||
|
||||
SettingsIdentity.prototype.onFocus = function ()
|
||||
IdentityAppSetting.prototype.onFocus = function ()
|
||||
{
|
||||
if (!this.editor && this.signatureDom())
|
||||
{
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
SettingsIdentity.prototype.onBuild = function ()
|
||||
IdentityAppSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var self = this;
|
||||
_.delay(function () {
|
||||
|
|
@ -98,6 +98,6 @@
|
|||
}, 50);
|
||||
};
|
||||
|
||||
module.exports = SettingsIdentity;
|
||||
module.exports = IdentityAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -6,15 +6,15 @@
|
|||
var
|
||||
ko = require('ko'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data')
|
||||
Data = require('Storage/App/Data')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsOpenPGP()
|
||||
function OpenPGPAppSetting()
|
||||
{
|
||||
this.openpgpkeys = Data.openpgpkeys;
|
||||
this.openpgpkeysPublic = Data.openpgpkeysPublic;
|
||||
|
|
@ -35,28 +35,28 @@
|
|||
]});
|
||||
}
|
||||
|
||||
SettingsOpenPGP.prototype.addOpenPgpKey = function ()
|
||||
OpenPGPAppSetting.prototype.addOpenPgpKey = function ()
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:AddOpenPgpKey'));
|
||||
kn.showScreenPopup(require('View/Popup/AddOpenPgpKey'));
|
||||
};
|
||||
|
||||
SettingsOpenPGP.prototype.generateOpenPgpKey = function ()
|
||||
OpenPGPAppSetting.prototype.generateOpenPgpKey = function ()
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:NewOpenPgpKey'));
|
||||
kn.showScreenPopup(require('View/Popup/NewOpenPgpKey'));
|
||||
};
|
||||
|
||||
SettingsOpenPGP.prototype.viewOpenPgpKey = function (oOpenPgpKey)
|
||||
OpenPGPAppSetting.prototype.viewOpenPgpKey = function (oOpenPgpKey)
|
||||
{
|
||||
if (oOpenPgpKey)
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:ViewOpenPgpKey'), [oOpenPgpKey]);
|
||||
kn.showScreenPopup(require('View/Popup/ViewOpenPgpKey'), [oOpenPgpKey]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {OpenPgpKeyModel} oOpenPgpKeyToRemove
|
||||
*/
|
||||
SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
|
||||
OpenPGPAppSetting.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
|
||||
{
|
||||
if (oOpenPgpKeyToRemove && oOpenPgpKeyToRemove.deleteAccess())
|
||||
{
|
||||
|
|
@ -73,11 +73,11 @@
|
|||
|
||||
Data.openpgpKeyring.store();
|
||||
|
||||
require('App:RainLoop').reloadOpenPgpKeys();
|
||||
require('App/App').reloadOpenPgpKeys();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = SettingsOpenPGP;
|
||||
module.exports = OpenPGPAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -10,13 +10,13 @@
|
|||
Globals = require('Common/Globals'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Remote = require('Storage:RainLoop:Remote')
|
||||
Remote = require('Storage/App/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsSecurity()
|
||||
function SecurityAppSetting()
|
||||
{
|
||||
this.processing = ko.observable(false);
|
||||
this.clearing = ko.observable(false);
|
||||
|
|
@ -46,37 +46,37 @@
|
|||
this.onSecretResult = _.bind(this.onSecretResult, this);
|
||||
}
|
||||
|
||||
SettingsSecurity.prototype.showSecret = function ()
|
||||
SecurityAppSetting.prototype.showSecret = function ()
|
||||
{
|
||||
this.secreting(true);
|
||||
Remote.showTwoFactorSecret(this.onSecretResult);
|
||||
};
|
||||
|
||||
SettingsSecurity.prototype.hideSecret = function ()
|
||||
SecurityAppSetting.prototype.hideSecret = function ()
|
||||
{
|
||||
this.viewSecret('');
|
||||
this.viewBackupCodes('');
|
||||
this.viewUrl('');
|
||||
};
|
||||
|
||||
SettingsSecurity.prototype.createTwoFactor = function ()
|
||||
SecurityAppSetting.prototype.createTwoFactor = function ()
|
||||
{
|
||||
this.processing(true);
|
||||
Remote.createTwoFactor(this.onResult);
|
||||
};
|
||||
|
||||
SettingsSecurity.prototype.enableTwoFactor = function ()
|
||||
SecurityAppSetting.prototype.enableTwoFactor = function ()
|
||||
{
|
||||
this.processing(true);
|
||||
Remote.enableTwoFactor(this.onResult, this.viewEnable());
|
||||
};
|
||||
|
||||
SettingsSecurity.prototype.testTwoFactor = function ()
|
||||
SecurityAppSetting.prototype.testTwoFactor = function ()
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:TwoFactorTest'));
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/TwoFactorTest'));
|
||||
};
|
||||
|
||||
SettingsSecurity.prototype.clearTwoFactor = function ()
|
||||
SecurityAppSetting.prototype.clearTwoFactor = function ()
|
||||
{
|
||||
this.viewSecret('');
|
||||
this.viewBackupCodes('');
|
||||
|
|
@ -86,14 +86,14 @@
|
|||
Remote.clearTwoFactor(this.onResult);
|
||||
};
|
||||
|
||||
SettingsSecurity.prototype.onShow = function ()
|
||||
SecurityAppSetting.prototype.onShow = function ()
|
||||
{
|
||||
this.viewSecret('');
|
||||
this.viewBackupCodes('');
|
||||
this.viewUrl('');
|
||||
};
|
||||
|
||||
SettingsSecurity.prototype.onResult = function (sResult, oData)
|
||||
SecurityAppSetting.prototype.onResult = function (sResult, oData)
|
||||
{
|
||||
this.processing(false);
|
||||
this.clearing(false);
|
||||
|
|
@ -139,7 +139,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
SettingsSecurity.prototype.onSecretResult = function (sResult, oData)
|
||||
SecurityAppSetting.prototype.onSecretResult = function (sResult, oData)
|
||||
{
|
||||
this.secreting(false);
|
||||
|
||||
|
|
@ -155,12 +155,12 @@
|
|||
}
|
||||
};
|
||||
|
||||
SettingsSecurity.prototype.onBuild = function ()
|
||||
SecurityAppSetting.prototype.onBuild = function ()
|
||||
{
|
||||
this.processing(true);
|
||||
Remote.getTwoFactor(this.onResult);
|
||||
};
|
||||
|
||||
module.exports = SettingsSecurity;
|
||||
module.exports = SecurityAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -6,11 +6,11 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsSocial()
|
||||
function SocialAppSetting()
|
||||
{
|
||||
var
|
||||
Utils = require('Common/Utils'),
|
||||
Data = require('Storage:RainLoop:Data')
|
||||
Data = require('Storage/App/Data')
|
||||
;
|
||||
|
||||
this.googleEnable = Data.googleEnable;
|
||||
|
|
@ -34,43 +34,43 @@
|
|||
this.connectGoogle = Utils.createCommand(this, function () {
|
||||
if (!this.googleLoggined())
|
||||
{
|
||||
require('App:RainLoop').googleConnect();
|
||||
require('App/App').googleConnect();
|
||||
}
|
||||
}, function () {
|
||||
return !this.googleLoggined() && !this.googleActions();
|
||||
});
|
||||
|
||||
this.disconnectGoogle = Utils.createCommand(this, function () {
|
||||
require('App:RainLoop').googleDisconnect();
|
||||
require('App/App').googleDisconnect();
|
||||
});
|
||||
|
||||
this.connectFacebook = Utils.createCommand(this, function () {
|
||||
if (!this.facebookLoggined())
|
||||
{
|
||||
require('App:RainLoop').facebookConnect();
|
||||
require('App/App').facebookConnect();
|
||||
}
|
||||
}, function () {
|
||||
return !this.facebookLoggined() && !this.facebookActions();
|
||||
});
|
||||
|
||||
this.disconnectFacebook = Utils.createCommand(this, function () {
|
||||
require('App:RainLoop').facebookDisconnect();
|
||||
require('App/App').facebookDisconnect();
|
||||
});
|
||||
|
||||
this.connectTwitter = Utils.createCommand(this, function () {
|
||||
if (!this.twitterLoggined())
|
||||
{
|
||||
require('App:RainLoop').twitterConnect();
|
||||
require('App/App').twitterConnect();
|
||||
}
|
||||
}, function () {
|
||||
return !this.twitterLoggined() && !this.twitterActions();
|
||||
});
|
||||
|
||||
this.disconnectTwitter = Utils.createCommand(this, function () {
|
||||
require('App:RainLoop').twitterDisconnect();
|
||||
require('App/App').twitterDisconnect();
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = SettingsSocial;
|
||||
module.exports = SocialAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -13,14 +13,14 @@
|
|||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote')
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function SettingsThemes()
|
||||
function ThemesAppSetting()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
}, this);
|
||||
}
|
||||
|
||||
SettingsThemes.prototype.onBuild = function ()
|
||||
ThemesAppSetting.prototype.onBuild = function ()
|
||||
{
|
||||
var sCurrentTheme = Data.theme();
|
||||
this.themesObjects(_.map(Data.themes(), function (sTheme) {
|
||||
|
|
@ -127,6 +127,6 @@
|
|||
}));
|
||||
};
|
||||
|
||||
module.exports = SettingsThemes;
|
||||
module.exports = ThemesAppSetting;
|
||||
|
||||
}());
|
||||
|
|
@ -8,18 +8,18 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage:Settings')
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function AbstractData()
|
||||
function AbstractDataStorate()
|
||||
{
|
||||
Utils.initDataConstructorBySettings(this);
|
||||
}
|
||||
|
||||
AbstractData.prototype.populateDataOnStart = function()
|
||||
AbstractDataStorate.prototype.populateDataOnStart = function()
|
||||
{
|
||||
var
|
||||
mLayout = Utils.pInt(Settings.settingsGet('Layout')),
|
||||
|
|
@ -88,6 +88,6 @@
|
|||
this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed'));
|
||||
};
|
||||
|
||||
module.exports = AbstractData;
|
||||
module.exports = AbstractDataStorate;
|
||||
|
||||
}());
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
Plugins = require('Common/Plugins'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Settings = require('Storage:Settings')
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
@ -8,14 +8,14 @@
|
|||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
|
||||
AbstractData = require('Storage:Abstract:Data')
|
||||
AbstractData = require('Storage/AbstractData')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractData
|
||||
*/
|
||||
function AdminDataStorage()
|
||||
function DataAdminStorage()
|
||||
{
|
||||
AbstractData.call(this);
|
||||
|
||||
|
|
@ -56,13 +56,13 @@
|
|||
}, this).extend({'rateLimit': 300});
|
||||
}
|
||||
|
||||
_.extend(AdminDataStorage.prototype, AbstractData.prototype);
|
||||
_.extend(DataAdminStorage.prototype, AbstractData.prototype);
|
||||
|
||||
AdminDataStorage.prototype.populateDataOnStart = function()
|
||||
DataAdminStorage.prototype.populateDataOnStart = function()
|
||||
{
|
||||
AbstractData.prototype.populateDataOnStart.call(this);
|
||||
};
|
||||
|
||||
module.exports = new AdminDataStorage();
|
||||
module.exports = new DataAdminStorage();
|
||||
|
||||
}());
|
||||
|
|
@ -7,28 +7,28 @@
|
|||
var
|
||||
_ = require('_'),
|
||||
|
||||
AbstractRemoteStorage = require('Storage:Abstract:Remote')
|
||||
AbstractRemoteStorage = require('Storage/AbstractRemote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractRemoteStorage
|
||||
*/
|
||||
function AdminRemoteStorage()
|
||||
function RemoteAdminStorage()
|
||||
{
|
||||
AbstractRemoteStorage.call(this);
|
||||
|
||||
this.oRequests = {};
|
||||
}
|
||||
|
||||
_.extend(AdminRemoteStorage.prototype, AbstractRemoteStorage.prototype);
|
||||
_.extend(RemoteAdminStorage.prototype, AbstractRemoteStorage.prototype);
|
||||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
* @param {string} sLogin
|
||||
* @param {string} sPassword
|
||||
*/
|
||||
AdminRemoteStorage.prototype.adminLogin = function (fCallback, sLogin, sPassword)
|
||||
RemoteAdminStorage.prototype.adminLogin = function (fCallback, sLogin, sPassword)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminLogin', {
|
||||
'Login': sLogin,
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
AdminRemoteStorage.prototype.adminLogout = function (fCallback)
|
||||
RemoteAdminStorage.prototype.adminLogout = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminLogout');
|
||||
};
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {?} oData
|
||||
*/
|
||||
AdminRemoteStorage.prototype.saveAdminConfig = function (fCallback, oData)
|
||||
RemoteAdminStorage.prototype.saveAdminConfig = function (fCallback, oData)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminSettingsUpdate', oData);
|
||||
};
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
AdminRemoteStorage.prototype.domainList = function (fCallback)
|
||||
RemoteAdminStorage.prototype.domainList = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminDomainList');
|
||||
};
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
AdminRemoteStorage.prototype.pluginList = function (fCallback)
|
||||
RemoteAdminStorage.prototype.pluginList = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminPluginList');
|
||||
};
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
AdminRemoteStorage.prototype.packagesList = function (fCallback)
|
||||
RemoteAdminStorage.prototype.packagesList = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminPackagesList');
|
||||
};
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
AdminRemoteStorage.prototype.coreData = function (fCallback)
|
||||
RemoteAdminStorage.prototype.coreData = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminCoreData');
|
||||
};
|
||||
|
|
@ -88,7 +88,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
AdminRemoteStorage.prototype.updateCoreData = function (fCallback)
|
||||
RemoteAdminStorage.prototype.updateCoreData = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminUpdateCoreData', {}, 90000);
|
||||
};
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {Object} oPackage
|
||||
*/
|
||||
AdminRemoteStorage.prototype.packageInstall = function (fCallback, oPackage)
|
||||
RemoteAdminStorage.prototype.packageInstall = function (fCallback, oPackage)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminPackageInstall', {
|
||||
'Id': oPackage.id,
|
||||
|
|
@ -110,7 +110,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {Object} oPackage
|
||||
*/
|
||||
AdminRemoteStorage.prototype.packageDelete = function (fCallback, oPackage)
|
||||
RemoteAdminStorage.prototype.packageDelete = function (fCallback, oPackage)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminPackageDelete', {
|
||||
'Id': oPackage.id
|
||||
|
|
@ -121,7 +121,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {string} sName
|
||||
*/
|
||||
AdminRemoteStorage.prototype.domain = function (fCallback, sName)
|
||||
RemoteAdminStorage.prototype.domain = function (fCallback, sName)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminDomainLoad', {
|
||||
'Name': sName
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {string} sName
|
||||
*/
|
||||
AdminRemoteStorage.prototype.plugin = function (fCallback, sName)
|
||||
RemoteAdminStorage.prototype.plugin = function (fCallback, sName)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminPluginLoad', {
|
||||
'Name': sName
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {string} sName
|
||||
*/
|
||||
AdminRemoteStorage.prototype.domainDelete = function (fCallback, sName)
|
||||
RemoteAdminStorage.prototype.domainDelete = function (fCallback, sName)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminDomainDelete', {
|
||||
'Name': sName
|
||||
|
|
@ -155,7 +155,7 @@
|
|||
* @param {string} sName
|
||||
* @param {boolean} bDisabled
|
||||
*/
|
||||
AdminRemoteStorage.prototype.domainDisable = function (fCallback, sName, bDisabled)
|
||||
RemoteAdminStorage.prototype.domainDisable = function (fCallback, sName, bDisabled)
|
||||
{
|
||||
return this.defaultRequest(fCallback, 'AdminDomainDisable', {
|
||||
'Name': sName,
|
||||
|
|
@ -167,7 +167,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {Object} oConfig
|
||||
*/
|
||||
AdminRemoteStorage.prototype.pluginSettingsUpdate = function (fCallback, oConfig)
|
||||
RemoteAdminStorage.prototype.pluginSettingsUpdate = function (fCallback, oConfig)
|
||||
{
|
||||
return this.defaultRequest(fCallback, 'AdminPluginSettingsUpdate', oConfig);
|
||||
};
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {boolean} bForce
|
||||
*/
|
||||
AdminRemoteStorage.prototype.licensing = function (fCallback, bForce)
|
||||
RemoteAdminStorage.prototype.licensing = function (fCallback, bForce)
|
||||
{
|
||||
return this.defaultRequest(fCallback, 'AdminLicensing', {
|
||||
'Force' : bForce ? '1' : '0'
|
||||
|
|
@ -188,7 +188,7 @@
|
|||
* @param {string} sDomain
|
||||
* @param {string} sKey
|
||||
*/
|
||||
AdminRemoteStorage.prototype.licensingActivate = function (fCallback, sDomain, sKey)
|
||||
RemoteAdminStorage.prototype.licensingActivate = function (fCallback, sDomain, sKey)
|
||||
{
|
||||
return this.defaultRequest(fCallback, 'AdminLicensingActivate', {
|
||||
'Domain' : sDomain,
|
||||
|
|
@ -201,7 +201,7 @@
|
|||
* @param {string} sName
|
||||
* @param {boolean} bDisabled
|
||||
*/
|
||||
AdminRemoteStorage.prototype.pluginDisable = function (fCallback, sName, bDisabled)
|
||||
RemoteAdminStorage.prototype.pluginDisable = function (fCallback, sName, bDisabled)
|
||||
{
|
||||
return this.defaultRequest(fCallback, 'AdminPluginDisable', {
|
||||
'Name': sName,
|
||||
|
|
@ -209,7 +209,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
AdminRemoteStorage.prototype.createOrUpdateDomain = function (fCallback,
|
||||
RemoteAdminStorage.prototype.createOrUpdateDomain = function (fCallback,
|
||||
bCreate, sName, sIncHost, iIncPort, sIncSecure, bIncShortLogin,
|
||||
sOutHost, iOutPort, sOutSecure, bOutShortLogin, bOutAuth, sWhiteList)
|
||||
{
|
||||
|
|
@ -229,7 +229,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
AdminRemoteStorage.prototype.testConnectionForDomain = function (fCallback, sName,
|
||||
RemoteAdminStorage.prototype.testConnectionForDomain = function (fCallback, sName,
|
||||
sIncHost, iIncPort, sIncSecure,
|
||||
sOutHost, iOutPort, sOutSecure, bOutAuth)
|
||||
{
|
||||
|
|
@ -249,7 +249,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {?} oData
|
||||
*/
|
||||
AdminRemoteStorage.prototype.testContacts = function (fCallback, oData)
|
||||
RemoteAdminStorage.prototype.testContacts = function (fCallback, oData)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminContactsTest', oData);
|
||||
};
|
||||
|
|
@ -258,7 +258,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {?} oData
|
||||
*/
|
||||
AdminRemoteStorage.prototype.saveNewAdminPassword = function (fCallback, oData)
|
||||
RemoteAdminStorage.prototype.saveNewAdminPassword = function (fCallback, oData)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminPasswordUpdate', oData);
|
||||
};
|
||||
|
|
@ -266,11 +266,11 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
AdminRemoteStorage.prototype.adminPing = function (fCallback)
|
||||
RemoteAdminStorage.prototype.adminPing = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AdminPing');
|
||||
};
|
||||
|
||||
module.exports = new AdminRemoteStorage();
|
||||
module.exports = new RemoteAdminStorage();
|
||||
|
||||
}());
|
||||
|
|
@ -11,13 +11,13 @@
|
|||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Settings = require('Storage:Settings')
|
||||
Settings = require('Storage/Settings')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function CacheStorage()
|
||||
function CacheAppStorage()
|
||||
{
|
||||
this.oFoldersCache = {};
|
||||
this.oFoldersNamesCache = {};
|
||||
|
|
@ -34,54 +34,54 @@
|
|||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
CacheStorage.prototype.bCapaGravatar = false;
|
||||
CacheAppStorage.prototype.bCapaGravatar = false;
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
CacheStorage.prototype.oFoldersCache = {};
|
||||
CacheAppStorage.prototype.oFoldersCache = {};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
CacheStorage.prototype.oFoldersNamesCache = {};
|
||||
CacheAppStorage.prototype.oFoldersNamesCache = {};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
CacheStorage.prototype.oFolderHashCache = {};
|
||||
CacheAppStorage.prototype.oFolderHashCache = {};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
CacheStorage.prototype.oFolderUidNextCache = {};
|
||||
CacheAppStorage.prototype.oFolderUidNextCache = {};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
CacheStorage.prototype.oMessageListHashCache = {};
|
||||
CacheAppStorage.prototype.oMessageListHashCache = {};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
CacheStorage.prototype.oMessageFlagsCache = {};
|
||||
CacheAppStorage.prototype.oMessageFlagsCache = {};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
CacheStorage.prototype.oBodies = {};
|
||||
CacheAppStorage.prototype.oBodies = {};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
CacheStorage.prototype.oNewMessage = {};
|
||||
CacheAppStorage.prototype.oNewMessage = {};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
CacheStorage.prototype.oRequestedMessage = {};
|
||||
CacheAppStorage.prototype.oRequestedMessage = {};
|
||||
|
||||
CacheStorage.prototype.clear = function ()
|
||||
CacheAppStorage.prototype.clear = function ()
|
||||
{
|
||||
this.oFoldersCache = {};
|
||||
this.oFoldersNamesCache = {};
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
* @param {Function} fCallback
|
||||
* @return {string}
|
||||
*/
|
||||
CacheStorage.prototype.getUserPic = function (sEmail, fCallback)
|
||||
CacheAppStorage.prototype.getUserPic = function (sEmail, fCallback)
|
||||
{
|
||||
sEmail = Utils.trim(sEmail);
|
||||
fCallback(this.bCapaGravatar && '' !== sEmail ? LinkBuilder.avatarLink(sEmail) : '', sEmail);
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
* @param {string} sUid
|
||||
* @return {string}
|
||||
*/
|
||||
CacheStorage.prototype.getMessageKey = function (sFolderFullNameRaw, sUid)
|
||||
CacheAppStorage.prototype.getMessageKey = function (sFolderFullNameRaw, sUid)
|
||||
{
|
||||
return sFolderFullNameRaw + '#' + sUid;
|
||||
};
|
||||
|
|
@ -118,7 +118,7 @@
|
|||
* @param {string} sFolder
|
||||
* @param {string} sUid
|
||||
*/
|
||||
CacheStorage.prototype.addRequestedMessage = function (sFolder, sUid)
|
||||
CacheAppStorage.prototype.addRequestedMessage = function (sFolder, sUid)
|
||||
{
|
||||
this.oRequestedMessage[this.getMessageKey(sFolder, sUid)] = true;
|
||||
};
|
||||
|
|
@ -128,7 +128,7 @@
|
|||
* @param {string} sUid
|
||||
* @return {boolean}
|
||||
*/
|
||||
CacheStorage.prototype.hasRequestedMessage = function (sFolder, sUid)
|
||||
CacheAppStorage.prototype.hasRequestedMessage = function (sFolder, sUid)
|
||||
{
|
||||
return true === this.oRequestedMessage[this.getMessageKey(sFolder, sUid)];
|
||||
};
|
||||
|
|
@ -137,7 +137,7 @@
|
|||
* @param {string} sFolderFullNameRaw
|
||||
* @param {string} sUid
|
||||
*/
|
||||
CacheStorage.prototype.addNewMessageCache = function (sFolderFullNameRaw, sUid)
|
||||
CacheAppStorage.prototype.addNewMessageCache = function (sFolderFullNameRaw, sUid)
|
||||
{
|
||||
this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)] = true;
|
||||
};
|
||||
|
|
@ -146,7 +146,7 @@
|
|||
* @param {string} sFolderFullNameRaw
|
||||
* @param {string} sUid
|
||||
*/
|
||||
CacheStorage.prototype.hasNewMessageAndRemoveFromCache = function (sFolderFullNameRaw, sUid)
|
||||
CacheAppStorage.prototype.hasNewMessageAndRemoveFromCache = function (sFolderFullNameRaw, sUid)
|
||||
{
|
||||
if (this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)])
|
||||
{
|
||||
|
|
@ -157,7 +157,7 @@
|
|||
return false;
|
||||
};
|
||||
|
||||
CacheStorage.prototype.clearNewMessageCache = function ()
|
||||
CacheAppStorage.prototype.clearNewMessageCache = function ()
|
||||
{
|
||||
this.oNewMessage = {};
|
||||
};
|
||||
|
|
@ -166,7 +166,7 @@
|
|||
* @param {string} sFolderHash
|
||||
* @return {string}
|
||||
*/
|
||||
CacheStorage.prototype.getFolderFullNameRaw = function (sFolderHash)
|
||||
CacheAppStorage.prototype.getFolderFullNameRaw = function (sFolderHash)
|
||||
{
|
||||
return '' !== sFolderHash && this.oFoldersNamesCache[sFolderHash] ? this.oFoldersNamesCache[sFolderHash] : '';
|
||||
};
|
||||
|
|
@ -175,7 +175,7 @@
|
|||
* @param {string} sFolderHash
|
||||
* @param {string} sFolderFullNameRaw
|
||||
*/
|
||||
CacheStorage.prototype.setFolderFullNameRaw = function (sFolderHash, sFolderFullNameRaw)
|
||||
CacheAppStorage.prototype.setFolderFullNameRaw = function (sFolderHash, sFolderFullNameRaw)
|
||||
{
|
||||
this.oFoldersNamesCache[sFolderHash] = sFolderFullNameRaw;
|
||||
};
|
||||
|
|
@ -184,7 +184,7 @@
|
|||
* @param {string} sFolderFullNameRaw
|
||||
* @return {string}
|
||||
*/
|
||||
CacheStorage.prototype.getFolderHash = function (sFolderFullNameRaw)
|
||||
CacheAppStorage.prototype.getFolderHash = function (sFolderFullNameRaw)
|
||||
{
|
||||
return '' !== sFolderFullNameRaw && this.oFolderHashCache[sFolderFullNameRaw] ? this.oFolderHashCache[sFolderFullNameRaw] : '';
|
||||
};
|
||||
|
|
@ -193,7 +193,7 @@
|
|||
* @param {string} sFolderFullNameRaw
|
||||
* @param {string} sFolderHash
|
||||
*/
|
||||
CacheStorage.prototype.setFolderHash = function (sFolderFullNameRaw, sFolderHash)
|
||||
CacheAppStorage.prototype.setFolderHash = function (sFolderFullNameRaw, sFolderHash)
|
||||
{
|
||||
this.oFolderHashCache[sFolderFullNameRaw] = sFolderHash;
|
||||
};
|
||||
|
|
@ -202,7 +202,7 @@
|
|||
* @param {string} sFolderFullNameRaw
|
||||
* @return {string}
|
||||
*/
|
||||
CacheStorage.prototype.getFolderUidNext = function (sFolderFullNameRaw)
|
||||
CacheAppStorage.prototype.getFolderUidNext = function (sFolderFullNameRaw)
|
||||
{
|
||||
return '' !== sFolderFullNameRaw && this.oFolderUidNextCache[sFolderFullNameRaw] ? this.oFolderUidNextCache[sFolderFullNameRaw] : '';
|
||||
};
|
||||
|
|
@ -211,7 +211,7 @@
|
|||
* @param {string} sFolderFullNameRaw
|
||||
* @param {string} sUidNext
|
||||
*/
|
||||
CacheStorage.prototype.setFolderUidNext = function (sFolderFullNameRaw, sUidNext)
|
||||
CacheAppStorage.prototype.setFolderUidNext = function (sFolderFullNameRaw, sUidNext)
|
||||
{
|
||||
this.oFolderUidNextCache[sFolderFullNameRaw] = sUidNext;
|
||||
};
|
||||
|
|
@ -220,7 +220,7 @@
|
|||
* @param {string} sFolderFullNameRaw
|
||||
* @return {?FolderModel}
|
||||
*/
|
||||
CacheStorage.prototype.getFolderFromCacheList = function (sFolderFullNameRaw)
|
||||
CacheAppStorage.prototype.getFolderFromCacheList = function (sFolderFullNameRaw)
|
||||
{
|
||||
return '' !== sFolderFullNameRaw && this.oFoldersCache[sFolderFullNameRaw] ? this.oFoldersCache[sFolderFullNameRaw] : null;
|
||||
};
|
||||
|
|
@ -229,7 +229,7 @@
|
|||
* @param {string} sFolderFullNameRaw
|
||||
* @param {?FolderModel} oFolder
|
||||
*/
|
||||
CacheStorage.prototype.setFolderToCacheList = function (sFolderFullNameRaw, oFolder)
|
||||
CacheAppStorage.prototype.setFolderToCacheList = function (sFolderFullNameRaw, oFolder)
|
||||
{
|
||||
this.oFoldersCache[sFolderFullNameRaw] = oFolder;
|
||||
};
|
||||
|
|
@ -237,7 +237,7 @@
|
|||
/**
|
||||
* @param {string} sFolderFullNameRaw
|
||||
*/
|
||||
CacheStorage.prototype.removeFolderFromCacheList = function (sFolderFullNameRaw)
|
||||
CacheAppStorage.prototype.removeFolderFromCacheList = function (sFolderFullNameRaw)
|
||||
{
|
||||
this.setFolderToCacheList(sFolderFullNameRaw, null);
|
||||
};
|
||||
|
|
@ -247,7 +247,7 @@
|
|||
* @param {string} sUid
|
||||
* @return {?Array}
|
||||
*/
|
||||
CacheStorage.prototype.getMessageFlagsFromCache = function (sFolderFullName, sUid)
|
||||
CacheAppStorage.prototype.getMessageFlagsFromCache = function (sFolderFullName, sUid)
|
||||
{
|
||||
return this.oMessageFlagsCache[sFolderFullName] && this.oMessageFlagsCache[sFolderFullName][sUid] ?
|
||||
this.oMessageFlagsCache[sFolderFullName][sUid] : null;
|
||||
|
|
@ -258,7 +258,7 @@
|
|||
* @param {string} sUid
|
||||
* @param {Array} aFlagsCache
|
||||
*/
|
||||
CacheStorage.prototype.setMessageFlagsToCache = function (sFolderFullName, sUid, aFlagsCache)
|
||||
CacheAppStorage.prototype.setMessageFlagsToCache = function (sFolderFullName, sUid, aFlagsCache)
|
||||
{
|
||||
if (!this.oMessageFlagsCache[sFolderFullName])
|
||||
{
|
||||
|
|
@ -271,7 +271,7 @@
|
|||
/**
|
||||
* @param {string} sFolderFullName
|
||||
*/
|
||||
CacheStorage.prototype.clearMessageFlagsFromCacheByFolder = function (sFolderFullName)
|
||||
CacheAppStorage.prototype.clearMessageFlagsFromCacheByFolder = function (sFolderFullName)
|
||||
{
|
||||
this.oMessageFlagsCache[sFolderFullName] = {};
|
||||
};
|
||||
|
|
@ -279,7 +279,7 @@
|
|||
/**
|
||||
* @param {(MessageModel|null)} oMessage
|
||||
*/
|
||||
CacheStorage.prototype.initMessageFlagsFromCache = function (oMessage)
|
||||
CacheAppStorage.prototype.initMessageFlagsFromCache = function (oMessage)
|
||||
{
|
||||
if (oMessage)
|
||||
{
|
||||
|
|
@ -320,7 +320,7 @@
|
|||
/**
|
||||
* @param {(MessageModel|null)} oMessage
|
||||
*/
|
||||
CacheStorage.prototype.storeMessageFlagsToCache = function (oMessage)
|
||||
CacheAppStorage.prototype.storeMessageFlagsToCache = function (oMessage)
|
||||
{
|
||||
if (oMessage)
|
||||
{
|
||||
|
|
@ -336,7 +336,7 @@
|
|||
* @param {string} sUid
|
||||
* @param {Array} aFlags
|
||||
*/
|
||||
CacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function (sFolder, sUid, aFlags)
|
||||
CacheAppStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function (sFolder, sUid, aFlags)
|
||||
{
|
||||
if (Utils.isArray(aFlags) && 0 < aFlags.length)
|
||||
{
|
||||
|
|
@ -344,6 +344,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
module.exports = new CacheStorage();
|
||||
module.exports = new CacheAppStorage();
|
||||
|
||||
}());
|
||||
|
|
@ -17,22 +17,22 @@
|
|||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Cache = require('Storage:RainLoop:Cache'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Cache = require('Storage/App/Cache'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
||||
MessageModel = require('Model/Message'),
|
||||
|
||||
LocalStorage = require('Storage:LocalStorage'),
|
||||
AbstractData = require('Storage:Abstract:Data')
|
||||
Local = require('Storage/Local'),
|
||||
AbstractData = require('Storage/AbstractData')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractData
|
||||
*/
|
||||
function DataStorage()
|
||||
function DataAppStorage()
|
||||
{
|
||||
AbstractData.call(this);
|
||||
|
||||
|
|
@ -323,7 +323,7 @@
|
|||
if (Enums.Layout.NoPreview === this.layout() &&
|
||||
-1 < window.location.hash.indexOf('message-preview'))
|
||||
{
|
||||
require('App:RainLoop').historyBack();
|
||||
require('App/App').historyBack();
|
||||
}
|
||||
}
|
||||
else if (Enums.Layout.NoPreview === this.layout())
|
||||
|
|
@ -471,9 +471,9 @@
|
|||
this.purgeMessageBodyCacheThrottle = _.throttle(this.purgeMessageBodyCache, 1000 * 30);
|
||||
}
|
||||
|
||||
_.extend(DataStorage.prototype, AbstractData.prototype);
|
||||
_.extend(DataAppStorage.prototype, AbstractData.prototype);
|
||||
|
||||
DataStorage.prototype.purgeMessageBodyCache = function()
|
||||
DataAppStorage.prototype.purgeMessageBodyCache = function()
|
||||
{
|
||||
var
|
||||
iCount = 0,
|
||||
|
|
@ -505,7 +505,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
DataStorage.prototype.populateDataOnStart = function()
|
||||
DataAppStorage.prototype.populateDataOnStart = function()
|
||||
{
|
||||
AbstractData.prototype.populateDataOnStart.call(this);
|
||||
|
||||
|
|
@ -522,7 +522,7 @@
|
|||
this.signatureToAll(!!Settings.settingsGet('SignatureToAll'));
|
||||
this.enableTwoFactor(!!Settings.settingsGet('EnableTwoFactor'));
|
||||
|
||||
this.lastFoldersHash = LocalStorage.get(Enums.ClientSideKeyName.FoldersLashHash) || '';
|
||||
this.lastFoldersHash = Local.get(Enums.ClientSideKeyName.FoldersLashHash) || '';
|
||||
|
||||
this.remoteSuggestions = !!Settings.settingsGet('RemoteSuggestions');
|
||||
|
||||
|
|
@ -530,7 +530,7 @@
|
|||
this.devPassword = Settings.settingsGet('DevPassword');
|
||||
};
|
||||
|
||||
DataStorage.prototype.initUidNextAndNewMessages = function (sFolder, sUidNext, aNewMessages)
|
||||
DataAppStorage.prototype.initUidNextAndNewMessages = function (sFolder, sUidNext, aNewMessages)
|
||||
{
|
||||
if ('INBOX' === sFolder && Utils.isNormal(sUidNext) && sUidNext !== '')
|
||||
{
|
||||
|
|
@ -609,7 +609,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
DataStorage.prototype.hideMessageBodies = function ()
|
||||
DataAppStorage.prototype.hideMessageBodies = function ()
|
||||
{
|
||||
var oMessagesBodiesDom = this.messagesBodiesDom();
|
||||
if (oMessagesBodiesDom)
|
||||
|
|
@ -622,7 +622,7 @@
|
|||
* @param {boolean=} bBoot = false
|
||||
* @returns {Array}
|
||||
*/
|
||||
DataStorage.prototype.getNextFolderNames = function (bBoot)
|
||||
DataAppStorage.prototype.getNextFolderNames = function (bBoot)
|
||||
{
|
||||
bBoot = Utils.isUnd(bBoot) ? false : !!bBoot;
|
||||
|
||||
|
|
@ -685,7 +685,7 @@
|
|||
* @param {string=} sToFolderFullNameRaw = ''
|
||||
* @param {bCopy=} bCopy = false
|
||||
*/
|
||||
DataStorage.prototype.removeMessagesFromList = function (
|
||||
DataAppStorage.prototype.removeMessagesFromList = function (
|
||||
sFromFolderFullNameRaw, aUidForRemove, sToFolderFullNameRaw, bCopy)
|
||||
{
|
||||
sToFolderFullNameRaw = Utils.isNormal(sToFolderFullNameRaw) ? sToFolderFullNameRaw : '';
|
||||
|
|
@ -782,7 +782,7 @@
|
|||
/**
|
||||
* @param {Object} oMessageTextBody
|
||||
*/
|
||||
DataStorage.prototype.initBlockquoteSwitcher = function (oMessageTextBody)
|
||||
DataAppStorage.prototype.initBlockquoteSwitcher = function (oMessageTextBody)
|
||||
{
|
||||
if (oMessageTextBody)
|
||||
{
|
||||
|
|
@ -814,10 +814,9 @@
|
|||
}
|
||||
};
|
||||
|
||||
DataStorage.prototype.setMessage = function (oData, bCached)
|
||||
DataAppStorage.prototype.setMessage = function (oData, bCached)
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
bIsHtml = false,
|
||||
bHasExternals = false,
|
||||
bHasInternals = false,
|
||||
|
|
@ -961,7 +960,7 @@
|
|||
Cache.initMessageFlagsFromCache(oMessage);
|
||||
if (oMessage.unseen())
|
||||
{
|
||||
require('App:RainLoop').setMessageSeen(oMessage);
|
||||
require('App/App').setMessageSeen(oMessage);
|
||||
}
|
||||
|
||||
Utils.windowResize();
|
||||
|
|
@ -972,21 +971,21 @@
|
|||
* @param {Array} aList
|
||||
* @returns {string}
|
||||
*/
|
||||
DataStorage.prototype.calculateMessageListHash = function (aList)
|
||||
DataAppStorage.prototype.calculateMessageListHash = function (aList)
|
||||
{
|
||||
return _.map(aList, function (oMessage) {
|
||||
return '' + oMessage.hash + '_' + oMessage.threadsLen() + '_' + oMessage.flagHash();
|
||||
}).join('|');
|
||||
};
|
||||
|
||||
DataStorage.prototype.findPublicKeyByHex = function (sHash)
|
||||
DataAppStorage.prototype.findPublicKeyByHex = function (sHash)
|
||||
{
|
||||
return _.find(this.openpgpkeysPublic(), function (oItem) {
|
||||
return oItem && sHash === oItem.id;
|
||||
});
|
||||
};
|
||||
|
||||
DataStorage.prototype.findPublicKeysByEmail = function (sEmail)
|
||||
DataAppStorage.prototype.findPublicKeysByEmail = function (sEmail)
|
||||
{
|
||||
var self = this;
|
||||
return _.compact(_.map(this.openpgpkeysPublic(), function (oItem) {
|
||||
|
|
@ -1015,7 +1014,7 @@
|
|||
* @param {string=} sPassword
|
||||
* @returns {?}
|
||||
*/
|
||||
DataStorage.prototype.findPrivateKeyByEmail = function (sEmail, sPassword)
|
||||
DataAppStorage.prototype.findPrivateKeyByEmail = function (sEmail, sPassword)
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -1053,11 +1052,11 @@
|
|||
* @param {string=} sPassword
|
||||
* @returns {?}
|
||||
*/
|
||||
DataStorage.prototype.findSelfPrivateKey = function (sPassword)
|
||||
DataAppStorage.prototype.findSelfPrivateKey = function (sPassword)
|
||||
{
|
||||
return this.findPrivateKeyByEmail(this.accountEmail(), sPassword);
|
||||
};
|
||||
|
||||
module.exports = new DataStorage();
|
||||
module.exports = new DataAppStorage();
|
||||
|
||||
}());
|
||||
|
|
@ -9,33 +9,32 @@
|
|||
|
||||
Utils = require('Common/Utils'),
|
||||
Consts = require('Common/Consts'),
|
||||
Globals = require('Common/Globals'),
|
||||
Base64 = require('Common/Base64'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Cache = require('Storage:RainLoop:Cache'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Cache = require('Storage/App/Cache'),
|
||||
Data = require('Storage/App/Data'),
|
||||
|
||||
AbstractRemoteStorage = require('Storage:Abstract:Remote')
|
||||
AbstractRemoteStorage = require('Storage/AbstractRemote')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractRemoteStorage
|
||||
*/
|
||||
function RemoteStorage()
|
||||
function RemoteAppStorage()
|
||||
{
|
||||
AbstractRemoteStorage.call(this);
|
||||
|
||||
this.oRequests = {};
|
||||
}
|
||||
|
||||
_.extend(RemoteStorage.prototype, AbstractRemoteStorage.prototype);
|
||||
_.extend(RemoteAppStorage.prototype, AbstractRemoteStorage.prototype);
|
||||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.folders = function (fCallback)
|
||||
RemoteAppStorage.prototype.folders = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'Folders', {
|
||||
'SentFolder': Settings.settingsGet('SentFolder'),
|
||||
|
|
@ -56,7 +55,7 @@
|
|||
* @param {string=} sAdditionalCode
|
||||
* @param {boolean=} bAdditionalCodeSignMe
|
||||
*/
|
||||
RemoteStorage.prototype.login = function (fCallback, sEmail, sLogin, sPassword, bSignMe, sLanguage, sAdditionalCode, bAdditionalCodeSignMe)
|
||||
RemoteAppStorage.prototype.login = function (fCallback, sEmail, sLogin, sPassword, bSignMe, sLanguage, sAdditionalCode, bAdditionalCodeSignMe)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'Login', {
|
||||
'Email': sEmail,
|
||||
|
|
@ -72,7 +71,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.getTwoFactor = function (fCallback)
|
||||
RemoteAppStorage.prototype.getTwoFactor = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'GetTwoFactorInfo');
|
||||
};
|
||||
|
|
@ -80,7 +79,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.createTwoFactor = function (fCallback)
|
||||
RemoteAppStorage.prototype.createTwoFactor = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'CreateTwoFactorSecret');
|
||||
};
|
||||
|
|
@ -88,7 +87,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.clearTwoFactor = function (fCallback)
|
||||
RemoteAppStorage.prototype.clearTwoFactor = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'ClearTwoFactorInfo');
|
||||
};
|
||||
|
|
@ -96,7 +95,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.showTwoFactorSecret = function (fCallback)
|
||||
RemoteAppStorage.prototype.showTwoFactorSecret = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'ShowTwoFactorSecret');
|
||||
};
|
||||
|
|
@ -105,7 +104,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {string} sCode
|
||||
*/
|
||||
RemoteStorage.prototype.testTwoFactor = function (fCallback, sCode)
|
||||
RemoteAppStorage.prototype.testTwoFactor = function (fCallback, sCode)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'TestTwoFactorInfo', {
|
||||
'Code': sCode
|
||||
|
|
@ -116,7 +115,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {boolean} bEnable
|
||||
*/
|
||||
RemoteStorage.prototype.enableTwoFactor = function (fCallback, bEnable)
|
||||
RemoteAppStorage.prototype.enableTwoFactor = function (fCallback, bEnable)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'EnableTwoFactor', {
|
||||
'Enable': bEnable ? '1' : '0'
|
||||
|
|
@ -126,7 +125,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.clearTwoFactorInfo = function (fCallback)
|
||||
RemoteAppStorage.prototype.clearTwoFactorInfo = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'ClearTwoFactorInfo');
|
||||
};
|
||||
|
|
@ -134,7 +133,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.contactsSync = function (fCallback)
|
||||
RemoteAppStorage.prototype.contactsSync = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'ContactsSync', null, Consts.Defaults.ContactsSyncAjaxTimeout);
|
||||
};
|
||||
|
|
@ -146,7 +145,7 @@
|
|||
* @param {string} sUser
|
||||
* @param {string} sPassword
|
||||
*/
|
||||
RemoteStorage.prototype.saveContactsSyncData = function (fCallback, bEnable, sUrl, sUser, sPassword)
|
||||
RemoteAppStorage.prototype.saveContactsSyncData = function (fCallback, bEnable, sUrl, sUser, sPassword)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SaveContactsSyncData', {
|
||||
'Enable': bEnable ? '1' : '0',
|
||||
|
|
@ -162,7 +161,7 @@
|
|||
* @param {string} sLogin
|
||||
* @param {string} sPassword
|
||||
*/
|
||||
RemoteStorage.prototype.accountAdd = function (fCallback, sEmail, sLogin, sPassword)
|
||||
RemoteAppStorage.prototype.accountAdd = function (fCallback, sEmail, sLogin, sPassword)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AccountAdd', {
|
||||
'Email': sEmail,
|
||||
|
|
@ -175,7 +174,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {string} sEmailToDelete
|
||||
*/
|
||||
RemoteStorage.prototype.accountDelete = function (fCallback, sEmailToDelete)
|
||||
RemoteAppStorage.prototype.accountDelete = function (fCallback, sEmailToDelete)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AccountDelete', {
|
||||
'EmailToDelete': sEmailToDelete
|
||||
|
|
@ -190,7 +189,7 @@
|
|||
* @param {string} sReplyTo
|
||||
* @param {string} sBcc
|
||||
*/
|
||||
RemoteStorage.prototype.identityUpdate = function (fCallback, sId, sEmail, sName, sReplyTo, sBcc)
|
||||
RemoteAppStorage.prototype.identityUpdate = function (fCallback, sId, sEmail, sName, sReplyTo, sBcc)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'IdentityUpdate', {
|
||||
'Id': sId,
|
||||
|
|
@ -205,7 +204,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {string} sIdToDelete
|
||||
*/
|
||||
RemoteStorage.prototype.identityDelete = function (fCallback, sIdToDelete)
|
||||
RemoteAppStorage.prototype.identityDelete = function (fCallback, sIdToDelete)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'IdentityDelete', {
|
||||
'IdToDelete': sIdToDelete
|
||||
|
|
@ -215,7 +214,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.accountsAndIdentities = function (fCallback)
|
||||
RemoteAppStorage.prototype.accountsAndIdentities = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AccountsAndIdentities');
|
||||
};
|
||||
|
|
@ -228,7 +227,7 @@
|
|||
* @param {string=} sSearch = ''
|
||||
* @param {boolean=} bSilent = false
|
||||
*/
|
||||
RemoteStorage.prototype.messageList = function (fCallback, sFolderFullNameRaw, iOffset, iLimit, sSearch, bSilent)
|
||||
RemoteAppStorage.prototype.messageList = function (fCallback, sFolderFullNameRaw, iOffset, iLimit, sSearch, bSilent)
|
||||
{
|
||||
sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw);
|
||||
|
||||
|
|
@ -275,7 +274,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {Array} aDownloads
|
||||
*/
|
||||
RemoteStorage.prototype.messageUploadAttachments = function (fCallback, aDownloads)
|
||||
RemoteAppStorage.prototype.messageUploadAttachments = function (fCallback, aDownloads)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'MessageUploadAttachments', {
|
||||
'Attachments': aDownloads
|
||||
|
|
@ -288,7 +287,7 @@
|
|||
* @param {number} iUid
|
||||
* @return {boolean}
|
||||
*/
|
||||
RemoteStorage.prototype.message = function (fCallback, sFolderFullNameRaw, iUid)
|
||||
RemoteAppStorage.prototype.message = function (fCallback, sFolderFullNameRaw, iUid)
|
||||
{
|
||||
sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw);
|
||||
iUid = Utils.pInt(iUid);
|
||||
|
|
@ -313,7 +312,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {Array} aExternals
|
||||
*/
|
||||
RemoteStorage.prototype.composeUploadExternals = function (fCallback, aExternals)
|
||||
RemoteAppStorage.prototype.composeUploadExternals = function (fCallback, aExternals)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'ComposeUploadExternals', {
|
||||
'Externals': aExternals
|
||||
|
|
@ -325,7 +324,7 @@
|
|||
* @param {string} sUrl
|
||||
* @param {string} sAccessToken
|
||||
*/
|
||||
RemoteStorage.prototype.composeUploadDrive = function (fCallback, sUrl, sAccessToken)
|
||||
RemoteAppStorage.prototype.composeUploadDrive = function (fCallback, sUrl, sAccessToken)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'ComposeUploadDrive', {
|
||||
'AccessToken': sAccessToken,
|
||||
|
|
@ -338,7 +337,7 @@
|
|||
* @param {string} sFolder
|
||||
* @param {Array=} aList = []
|
||||
*/
|
||||
RemoteStorage.prototype.folderInformation = function (fCallback, sFolder, aList)
|
||||
RemoteAppStorage.prototype.folderInformation = function (fCallback, sFolder, aList)
|
||||
{
|
||||
var
|
||||
bRequest = true,
|
||||
|
|
@ -381,7 +380,7 @@
|
|||
}
|
||||
else if (Data.useThreads())
|
||||
{
|
||||
require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -389,7 +388,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {Array} aFolders
|
||||
*/
|
||||
RemoteStorage.prototype.folderInformationMultiply = function (fCallback, aFolders)
|
||||
RemoteAppStorage.prototype.folderInformationMultiply = function (fCallback, aFolders)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'FolderInformationMultiply', {
|
||||
'Folders': aFolders
|
||||
|
|
@ -399,7 +398,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.logout = function (fCallback)
|
||||
RemoteAppStorage.prototype.logout = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'Logout');
|
||||
};
|
||||
|
|
@ -410,7 +409,7 @@
|
|||
* @param {Array} aUids
|
||||
* @param {boolean} bSetFlagged
|
||||
*/
|
||||
RemoteStorage.prototype.messageSetFlagged = function (fCallback, sFolderFullNameRaw, aUids, bSetFlagged)
|
||||
RemoteAppStorage.prototype.messageSetFlagged = function (fCallback, sFolderFullNameRaw, aUids, bSetFlagged)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'MessageSetFlagged', {
|
||||
'Folder': sFolderFullNameRaw,
|
||||
|
|
@ -425,7 +424,7 @@
|
|||
* @param {Array} aUids
|
||||
* @param {boolean} bSetSeen
|
||||
*/
|
||||
RemoteStorage.prototype.messageSetSeen = function (fCallback, sFolderFullNameRaw, aUids, bSetSeen)
|
||||
RemoteAppStorage.prototype.messageSetSeen = function (fCallback, sFolderFullNameRaw, aUids, bSetSeen)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'MessageSetSeen', {
|
||||
'Folder': sFolderFullNameRaw,
|
||||
|
|
@ -439,7 +438,7 @@
|
|||
* @param {string} sFolderFullNameRaw
|
||||
* @param {boolean} bSetSeen
|
||||
*/
|
||||
RemoteStorage.prototype.messageSetSeenToAll = function (fCallback, sFolderFullNameRaw, bSetSeen)
|
||||
RemoteAppStorage.prototype.messageSetSeenToAll = function (fCallback, sFolderFullNameRaw, bSetSeen)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'MessageSetSeenToAll', {
|
||||
'Folder': sFolderFullNameRaw,
|
||||
|
|
@ -464,7 +463,7 @@
|
|||
* @param {string} sInReplyTo
|
||||
* @param {string} sReferences
|
||||
*/
|
||||
RemoteStorage.prototype.saveMessage = function (fCallback, sMessageFolder, sMessageUid, sDraftFolder,
|
||||
RemoteAppStorage.prototype.saveMessage = function (fCallback, sMessageFolder, sMessageUid, sDraftFolder,
|
||||
sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SaveMessage', {
|
||||
|
|
@ -494,7 +493,7 @@
|
|||
* @param {string} sSubject
|
||||
* @param {string} sText
|
||||
*/
|
||||
RemoteStorage.prototype.sendReadReceiptMessage = function (fCallback, sMessageFolder, sMessageUid, sReadReceipt, sSubject, sText)
|
||||
RemoteAppStorage.prototype.sendReadReceiptMessage = function (fCallback, sMessageFolder, sMessageUid, sReadReceipt, sSubject, sText)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SendReadReceiptMessage', {
|
||||
'MessageFolder': sMessageFolder,
|
||||
|
|
@ -523,7 +522,7 @@
|
|||
* @param {string} sReferences
|
||||
* @param {boolean} bRequestReadReceipt
|
||||
*/
|
||||
RemoteStorage.prototype.sendMessage = function (fCallback, sMessageFolder, sMessageUid, sSentFolder,
|
||||
RemoteAppStorage.prototype.sendMessage = function (fCallback, sMessageFolder, sMessageUid, sSentFolder,
|
||||
sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences, bRequestReadReceipt)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SendMessage', {
|
||||
|
|
@ -549,7 +548,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {Object} oData
|
||||
*/
|
||||
RemoteStorage.prototype.saveSystemFolders = function (fCallback, oData)
|
||||
RemoteAppStorage.prototype.saveSystemFolders = function (fCallback, oData)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SystemFoldersUpdate', oData);
|
||||
};
|
||||
|
|
@ -558,7 +557,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {Object} oData
|
||||
*/
|
||||
RemoteStorage.prototype.saveSettings = function (fCallback, oData)
|
||||
RemoteAppStorage.prototype.saveSettings = function (fCallback, oData)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SettingsUpdate', oData);
|
||||
};
|
||||
|
|
@ -568,7 +567,7 @@
|
|||
* @param {string} sPrevPassword
|
||||
* @param {string} sNewPassword
|
||||
*/
|
||||
RemoteStorage.prototype.changePassword = function (fCallback, sPrevPassword, sNewPassword)
|
||||
RemoteAppStorage.prototype.changePassword = function (fCallback, sPrevPassword, sNewPassword)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'ChangePassword', {
|
||||
'PrevPassword': sPrevPassword,
|
||||
|
|
@ -581,7 +580,7 @@
|
|||
* @param {string} sNewFolderName
|
||||
* @param {string} sParentName
|
||||
*/
|
||||
RemoteStorage.prototype.folderCreate = function (fCallback, sNewFolderName, sParentName)
|
||||
RemoteAppStorage.prototype.folderCreate = function (fCallback, sNewFolderName, sParentName)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'FolderCreate', {
|
||||
'Folder': sNewFolderName,
|
||||
|
|
@ -593,7 +592,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {string} sFolderFullNameRaw
|
||||
*/
|
||||
RemoteStorage.prototype.folderDelete = function (fCallback, sFolderFullNameRaw)
|
||||
RemoteAppStorage.prototype.folderDelete = function (fCallback, sFolderFullNameRaw)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'FolderDelete', {
|
||||
'Folder': sFolderFullNameRaw
|
||||
|
|
@ -605,7 +604,7 @@
|
|||
* @param {string} sPrevFolderFullNameRaw
|
||||
* @param {string} sNewFolderName
|
||||
*/
|
||||
RemoteStorage.prototype.folderRename = function (fCallback, sPrevFolderFullNameRaw, sNewFolderName)
|
||||
RemoteAppStorage.prototype.folderRename = function (fCallback, sPrevFolderFullNameRaw, sNewFolderName)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'FolderRename', {
|
||||
'Folder': sPrevFolderFullNameRaw,
|
||||
|
|
@ -617,7 +616,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {string} sFolderFullNameRaw
|
||||
*/
|
||||
RemoteStorage.prototype.folderClear = function (fCallback, sFolderFullNameRaw)
|
||||
RemoteAppStorage.prototype.folderClear = function (fCallback, sFolderFullNameRaw)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'FolderClear', {
|
||||
'Folder': sFolderFullNameRaw
|
||||
|
|
@ -629,7 +628,7 @@
|
|||
* @param {string} sFolderFullNameRaw
|
||||
* @param {boolean} bSubscribe
|
||||
*/
|
||||
RemoteStorage.prototype.folderSetSubscribe = function (fCallback, sFolderFullNameRaw, bSubscribe)
|
||||
RemoteAppStorage.prototype.folderSetSubscribe = function (fCallback, sFolderFullNameRaw, bSubscribe)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'FolderSubscribe', {
|
||||
'Folder': sFolderFullNameRaw,
|
||||
|
|
@ -644,7 +643,7 @@
|
|||
* @param {Array} aUids
|
||||
* @param {string=} sLearning
|
||||
*/
|
||||
RemoteStorage.prototype.messagesMove = function (fCallback, sFolder, sToFolder, aUids, sLearning)
|
||||
RemoteAppStorage.prototype.messagesMove = function (fCallback, sFolder, sToFolder, aUids, sLearning)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'MessageMove', {
|
||||
'FromFolder': sFolder,
|
||||
|
|
@ -660,7 +659,7 @@
|
|||
* @param {string} sToFolder
|
||||
* @param {Array} aUids
|
||||
*/
|
||||
RemoteStorage.prototype.messagesCopy = function (fCallback, sFolder, sToFolder, aUids)
|
||||
RemoteAppStorage.prototype.messagesCopy = function (fCallback, sFolder, sToFolder, aUids)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'MessageCopy', {
|
||||
'FromFolder': sFolder,
|
||||
|
|
@ -674,7 +673,7 @@
|
|||
* @param {string} sFolder
|
||||
* @param {Array} aUids
|
||||
*/
|
||||
RemoteStorage.prototype.messagesDelete = function (fCallback, sFolder, aUids)
|
||||
RemoteAppStorage.prototype.messagesDelete = function (fCallback, sFolder, aUids)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'MessageDelete', {
|
||||
'Folder': sFolder,
|
||||
|
|
@ -685,7 +684,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.appDelayStart = function (fCallback)
|
||||
RemoteAppStorage.prototype.appDelayStart = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'AppDelayStart');
|
||||
};
|
||||
|
|
@ -693,7 +692,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.quota = function (fCallback)
|
||||
RemoteAppStorage.prototype.quota = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'Quota');
|
||||
};
|
||||
|
|
@ -704,7 +703,7 @@
|
|||
* @param {number} iLimit
|
||||
* @param {string} sSearch
|
||||
*/
|
||||
RemoteStorage.prototype.contacts = function (fCallback, iOffset, iLimit, sSearch)
|
||||
RemoteAppStorage.prototype.contacts = function (fCallback, iOffset, iLimit, sSearch)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'Contacts', {
|
||||
'Offset': iOffset,
|
||||
|
|
@ -716,7 +715,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.contactSave = function (fCallback, sRequestUid, sUid, sTags, aProperties)
|
||||
RemoteAppStorage.prototype.contactSave = function (fCallback, sRequestUid, sUid, sTags, aProperties)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'ContactSave', {
|
||||
'RequestUid': sRequestUid,
|
||||
|
|
@ -730,7 +729,7 @@
|
|||
* @param {?Function} fCallback
|
||||
* @param {Array} aUids
|
||||
*/
|
||||
RemoteStorage.prototype.contactsDelete = function (fCallback, aUids)
|
||||
RemoteAppStorage.prototype.contactsDelete = function (fCallback, aUids)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'ContactsDelete', {
|
||||
'Uids': aUids.join(',')
|
||||
|
|
@ -742,7 +741,7 @@
|
|||
* @param {string} sQuery
|
||||
* @param {number} iPage
|
||||
*/
|
||||
RemoteStorage.prototype.suggestions = function (fCallback, sQuery, iPage)
|
||||
RemoteAppStorage.prototype.suggestions = function (fCallback, sQuery, iPage)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'Suggestions', {
|
||||
'Query': sQuery,
|
||||
|
|
@ -753,7 +752,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.facebookUser = function (fCallback)
|
||||
RemoteAppStorage.prototype.facebookUser = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SocialFacebookUserInformation');
|
||||
};
|
||||
|
|
@ -761,7 +760,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.facebookDisconnect = function (fCallback)
|
||||
RemoteAppStorage.prototype.facebookDisconnect = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SocialFacebookDisconnect');
|
||||
};
|
||||
|
|
@ -769,7 +768,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.twitterUser = function (fCallback)
|
||||
RemoteAppStorage.prototype.twitterUser = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SocialTwitterUserInformation');
|
||||
};
|
||||
|
|
@ -777,7 +776,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.twitterDisconnect = function (fCallback)
|
||||
RemoteAppStorage.prototype.twitterDisconnect = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SocialTwitterDisconnect');
|
||||
};
|
||||
|
|
@ -785,7 +784,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.googleUser = function (fCallback)
|
||||
RemoteAppStorage.prototype.googleUser = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SocialGoogleUserInformation');
|
||||
};
|
||||
|
|
@ -793,7 +792,7 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.googleDisconnect = function (fCallback)
|
||||
RemoteAppStorage.prototype.googleDisconnect = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SocialGoogleDisconnect');
|
||||
};
|
||||
|
|
@ -801,11 +800,11 @@
|
|||
/**
|
||||
* @param {?Function} fCallback
|
||||
*/
|
||||
RemoteStorage.prototype.socialUsers = function (fCallback)
|
||||
RemoteAppStorage.prototype.socialUsers = function (fCallback)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'SocialUsers');
|
||||
};
|
||||
|
||||
module.exports = new RemoteStorage();
|
||||
module.exports = new RemoteAppStorage();
|
||||
|
||||
}());
|
||||
|
|
@ -11,8 +11,8 @@
|
|||
{
|
||||
var
|
||||
NextStorageDriver = require('_').find([
|
||||
require('Storage:LocalStorage:LocalStorage'),
|
||||
require('Storage:LocalStorage:Cookie')
|
||||
require('Storage/LocalDriver/LocalStorage'),
|
||||
require('Storage/LocalDriver/Cookie')
|
||||
], function (NextStorageDriver) {
|
||||
return NextStorageDriver && NextStorageDriver.supported();
|
||||
})
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function CookieDriver()
|
||||
function CookieLocalDriver()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
* @static
|
||||
* @return {boolean}
|
||||
*/
|
||||
CookieDriver.supported = function ()
|
||||
CookieLocalDriver.supported = function ()
|
||||
{
|
||||
return !!(window.navigator && window.navigator.cookieEnabled);
|
||||
};
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
* @param {*} mData
|
||||
* @return {boolean}
|
||||
*/
|
||||
CookieDriver.prototype.set = function (sKey, mData)
|
||||
CookieLocalDriver.prototype.set = function (sKey, mData)
|
||||
{
|
||||
var
|
||||
mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName),
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
* @param {string} sKey
|
||||
* @return {*}
|
||||
*/
|
||||
CookieDriver.prototype.get = function (sKey)
|
||||
CookieLocalDriver.prototype.get = function (sKey)
|
||||
{
|
||||
var
|
||||
mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName),
|
||||
|
|
@ -95,6 +95,6 @@
|
|||
return mResult;
|
||||
};
|
||||
|
||||
module.exports = CookieDriver;
|
||||
module.exports = CookieLocalDriver;
|
||||
|
||||
}());
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function LocalStorageDriver()
|
||||
function LocalStorageLocalDriver()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
* @static
|
||||
* @return {boolean}
|
||||
*/
|
||||
LocalStorageDriver.supported = function ()
|
||||
LocalStorageLocalDriver.supported = function ()
|
||||
{
|
||||
return !!window.localStorage;
|
||||
};
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
* @param {*} mData
|
||||
* @return {boolean}
|
||||
*/
|
||||
LocalStorageDriver.prototype.set = function (sKey, mData)
|
||||
LocalStorageLocalDriver.prototype.set = function (sKey, mData)
|
||||
{
|
||||
var
|
||||
mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null,
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
* @param {string} sKey
|
||||
* @return {*}
|
||||
*/
|
||||
LocalStorageDriver.prototype.get = function (sKey)
|
||||
LocalStorageLocalDriver.prototype.get = function (sKey)
|
||||
{
|
||||
var
|
||||
mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null,
|
||||
|
|
@ -93,6 +93,6 @@
|
|||
return mResult;
|
||||
};
|
||||
|
||||
module.exports = LocalStorageDriver;
|
||||
module.exports = LocalStorageLocalDriver;
|
||||
|
||||
}());
|
||||
|
|
@ -10,19 +10,19 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Remote = require('Storage:Admin:Remote'),
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function AdminLoginViewModel()
|
||||
function LoginAdminView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Center', 'AdminLogin');
|
||||
AbstractView.call(this, 'Center', 'AdminLogin');
|
||||
|
||||
this.login = ko.observable('');
|
||||
this.password = ko.observable('');
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
{
|
||||
if (oData.Result)
|
||||
{
|
||||
require('App:Admin').loginAndLogoutReload();
|
||||
require('App/Admin').loginAndLogoutReload();
|
||||
}
|
||||
else if (oData.ErrorCode)
|
||||
{
|
||||
|
|
@ -88,10 +88,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Admin:Login', 'AdminLoginViewModel'], AdminLoginViewModel);
|
||||
_.extend(AdminLoginViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Admin/Login', 'AdminLoginViewModel'], LoginAdminView);
|
||||
_.extend(LoginAdminView.prototype, AbstractView.prototype);
|
||||
|
||||
AdminLoginViewModel.prototype.onShow = function ()
|
||||
LoginAdminView.prototype.onShow = function ()
|
||||
{
|
||||
kn.routeOff();
|
||||
|
||||
|
|
@ -101,21 +101,21 @@
|
|||
|
||||
};
|
||||
|
||||
AdminLoginViewModel.prototype.onHide = function ()
|
||||
LoginAdminView.prototype.onHide = function ()
|
||||
{
|
||||
this.loginFocus(false);
|
||||
};
|
||||
|
||||
AdminLoginViewModel.prototype.onBuild = function ()
|
||||
LoginAdminView.prototype.onBuild = function ()
|
||||
{
|
||||
Utils.triggerAutocompleteInputChange(true);
|
||||
};
|
||||
|
||||
AdminLoginViewModel.prototype.submitForm = function ()
|
||||
LoginAdminView.prototype.submitForm = function ()
|
||||
{
|
||||
this.submitCommand();
|
||||
};
|
||||
|
||||
module.exports = AdminLoginViewModel;
|
||||
module.exports = LoginAdminView;
|
||||
|
||||
}());
|
||||
42
dev/View/Admin/Settings/Menu.js
Normal file
42
dev/View/Admin/Settings/Menu.js
Normal 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;
|
||||
|
||||
}());
|
||||
46
dev/View/Admin/Settings/Pane.js
Normal file
46
dev/View/Admin/Settings/Pane.js
Normal 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
34
dev/View/App/About.js
Normal 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;
|
||||
|
||||
}());
|
||||
|
|
@ -13,20 +13,20 @@
|
|||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function AbstractSystemDropDownViewModel()
|
||||
function AbstractSystemDropDownAppView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Right', 'SystemDropDown');
|
||||
AbstractView.call(this, 'Right', 'SystemDropDown');
|
||||
|
||||
this.accounts = Data.accounts;
|
||||
this.accountEmail = Data.accountEmail;
|
||||
|
|
@ -43,9 +43,9 @@
|
|||
this.accountClick = _.bind(this.accountClick, this);
|
||||
}
|
||||
|
||||
_.extend(AbstractSystemDropDownViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
_.extend(AbstractSystemDropDownAppView.prototype, AbstractView.prototype);
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.accountClick = function (oAccount, oEvent)
|
||||
AbstractSystemDropDownAppView.prototype.accountClick = function (oAccount, oEvent)
|
||||
{
|
||||
if (oAccount && oEvent && !Utils.isUnd(oEvent.which) && 1 === oEvent.which)
|
||||
{
|
||||
|
|
@ -59,30 +59,30 @@
|
|||
return true;
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.emailTitle = function ()
|
||||
AbstractSystemDropDownAppView.prototype.emailTitle = function ()
|
||||
{
|
||||
return Data.accountEmail();
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.settingsClick = function ()
|
||||
AbstractSystemDropDownAppView.prototype.settingsClick = function ()
|
||||
{
|
||||
require('App:Knoin').setHash(LinkBuilder.settings());
|
||||
require('Knoin/Knoin').setHash(LinkBuilder.settings());
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.settingsHelp = function ()
|
||||
AbstractSystemDropDownAppView.prototype.settingsHelp = function ()
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:KeyboardShortcutsHelp'));
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/KeyboardShortcutsHelp'));
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.addAccountClick = function ()
|
||||
AbstractSystemDropDownAppView.prototype.addAccountClick = function ()
|
||||
{
|
||||
if (this.capaAdditionalAccounts)
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:AddAccount'));
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount'));
|
||||
}
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.logoutClick = function ()
|
||||
AbstractSystemDropDownAppView.prototype.logoutClick = function ()
|
||||
{
|
||||
Remote.logout(function () {
|
||||
if (window.__rlah_clear)
|
||||
|
|
@ -90,12 +90,12 @@
|
|||
window.__rlah_clear();
|
||||
}
|
||||
|
||||
require('App:RainLoop').loginAndLogoutReload(true,
|
||||
require('App/App').loginAndLogoutReload(true,
|
||||
Settings.settingsGet('ParentEmail') && 0 < Settings.settingsGet('ParentEmail').length);
|
||||
});
|
||||
};
|
||||
|
||||
AbstractSystemDropDownViewModel.prototype.onBuild = function ()
|
||||
AbstractSystemDropDownAppView.prototype.onBuild = function ()
|
||||
{
|
||||
var self = this;
|
||||
key('`', [Enums.KeyState.MessageList, Enums.KeyState.MessageView, Enums.KeyState.Settings], function () {
|
||||
|
|
@ -109,12 +109,12 @@
|
|||
key('shift+/', [Enums.KeyState.MessageList, Enums.KeyState.MessageView, Enums.KeyState.Settings], function () {
|
||||
if (self.viewModelVisibility())
|
||||
{
|
||||
require('App:Knoin').showScreenPopup(require('View:Popup:KeyboardShortcutsHelp'));
|
||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/KeyboardShortcutsHelp'));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = AbstractSystemDropDownViewModel;
|
||||
module.exports = AbstractSystemDropDownAppView;
|
||||
|
||||
}());
|
||||
|
|
@ -13,21 +13,21 @@
|
|||
Utils = require('Common/Utils'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function LoginViewModel()
|
||||
function LoginAppView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Center', 'Login');
|
||||
AbstractView.call(this, 'Center', 'Login');
|
||||
|
||||
this.email = ko.observable('');
|
||||
this.password = ko.observable('');
|
||||
|
|
@ -130,7 +130,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
require('App:RainLoop').loginAndLogoutReload();
|
||||
require('App/App').loginAndLogoutReload();
|
||||
}
|
||||
}
|
||||
else if (oData.ErrorCode)
|
||||
|
|
@ -249,10 +249,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:RainLoop:Login', 'LoginViewModel'], LoginViewModel);
|
||||
_.extend(LoginViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/App/Login', 'LoginViewModel'], LoginAppView);
|
||||
_.extend(LoginAppView.prototype, AbstractView.prototype);
|
||||
|
||||
LoginViewModel.prototype.onShow = function ()
|
||||
LoginAppView.prototype.onShow = function ()
|
||||
{
|
||||
kn.routeOff();
|
||||
|
||||
|
|
@ -274,13 +274,13 @@
|
|||
}, this), 100);
|
||||
};
|
||||
|
||||
LoginViewModel.prototype.onHide = function ()
|
||||
LoginAppView.prototype.onHide = function ()
|
||||
{
|
||||
this.submitFocus(false);
|
||||
this.emailFocus(false);
|
||||
};
|
||||
|
||||
LoginViewModel.prototype.onBuild = function ()
|
||||
LoginAppView.prototype.onBuild = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -290,7 +290,7 @@
|
|||
if (0 === iErrorCode)
|
||||
{
|
||||
self.submitRequest(true);
|
||||
require('App:RainLoop').loginAndLogoutReload();
|
||||
require('App/App').loginAndLogoutReload();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -353,16 +353,16 @@
|
|||
Utils.triggerAutocompleteInputChange(true);
|
||||
};
|
||||
|
||||
LoginViewModel.prototype.submitForm = function ()
|
||||
LoginAppView.prototype.submitForm = function ()
|
||||
{
|
||||
this.submitCommand();
|
||||
};
|
||||
|
||||
LoginViewModel.prototype.selectLanguage = function ()
|
||||
LoginAppView.prototype.selectLanguage = function ()
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:Languages'));
|
||||
kn.showScreenPopup(require('View/Popup/Languages'));
|
||||
};
|
||||
|
||||
module.exports = LoginViewModel;
|
||||
module.exports = LoginAppView;
|
||||
|
||||
}());
|
||||
|
|
@ -15,21 +15,21 @@
|
|||
Globals = require('Common/Globals'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Cache = require('Storage:RainLoop:Cache'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Cache = require('Storage/App/Cache'),
|
||||
Data = require('Storage/App/Data'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function MailBoxFolderListViewModel()
|
||||
function FolderListMailBoxAppView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Left', 'MailFolderList');
|
||||
AbstractView.call(this, 'Left', 'MailFolderList');
|
||||
|
||||
this.oContentVisible = null;
|
||||
this.oContentScrollable = null;
|
||||
|
|
@ -48,10 +48,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:RainLoop:MailBoxFolderList', 'MailBoxFolderListViewModel'], MailBoxFolderListViewModel);
|
||||
_.extend(MailBoxFolderListViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/App/MailBox/FolderList', 'MailBoxFolderListViewModel'], FolderListMailBoxAppView);
|
||||
_.extend(FolderListMailBoxAppView.prototype, AbstractView.prototype);
|
||||
|
||||
MailBoxFolderListViewModel.prototype.onBuild = function (oDom)
|
||||
FolderListMailBoxAppView.prototype.onBuild = function (oDom)
|
||||
{
|
||||
this.oContentVisible = $('.b-content', oDom);
|
||||
this.oContentScrollable = $('.content', this.oContentVisible);
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
if (oFolder && oEvent)
|
||||
{
|
||||
bCollapsed = oFolder.collapsed();
|
||||
require('App:RainLoop').setExpandedFolder(oFolder.fullNameHash, bCollapsed);
|
||||
require('App/App').setExpandedFolder(oFolder.fullNameHash, bCollapsed);
|
||||
|
||||
oFolder.collapsed(!bCollapsed);
|
||||
oEvent.preventDefault();
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
if (oFolder)
|
||||
{
|
||||
bCollapsed = oFolder.collapsed();
|
||||
require('App:RainLoop').setExpandedFolder(oFolder.fullNameHash, bCollapsed);
|
||||
require('App/App').setExpandedFolder(oFolder.fullNameHash, bCollapsed);
|
||||
oFolder.collapsed(!bCollapsed);
|
||||
}
|
||||
}
|
||||
|
|
@ -174,25 +174,25 @@
|
|||
});
|
||||
};
|
||||
|
||||
MailBoxFolderListViewModel.prototype.messagesDropOver = function (oFolder)
|
||||
FolderListMailBoxAppView.prototype.messagesDropOver = function (oFolder)
|
||||
{
|
||||
window.clearTimeout(this.iDropOverTimer);
|
||||
if (oFolder && oFolder.collapsed())
|
||||
{
|
||||
this.iDropOverTimer = window.setTimeout(function () {
|
||||
oFolder.collapsed(false);
|
||||
require('App:RainLoop').setExpandedFolder(oFolder.fullNameHash, true);
|
||||
require('App/App').setExpandedFolder(oFolder.fullNameHash, true);
|
||||
Utils.windowResize();
|
||||
}, 500);
|
||||
}
|
||||
};
|
||||
|
||||
MailBoxFolderListViewModel.prototype.messagesDropOut = function ()
|
||||
FolderListMailBoxAppView.prototype.messagesDropOut = function ()
|
||||
{
|
||||
window.clearTimeout(this.iDropOverTimer);
|
||||
};
|
||||
|
||||
MailBoxFolderListViewModel.prototype.scrollToFocused = function ()
|
||||
FolderListMailBoxAppView.prototype.scrollToFocused = function ()
|
||||
{
|
||||
if (!this.oContentVisible || !this.oContentScrollable)
|
||||
{
|
||||
|
|
@ -229,7 +229,7 @@
|
|||
* @param {FolderModel} oToFolder
|
||||
* @param {{helper:jQuery}} oUi
|
||||
*/
|
||||
MailBoxFolderListViewModel.prototype.messagesDrop = function (oToFolder, oUi)
|
||||
FolderListMailBoxAppView.prototype.messagesDrop = function (oToFolder, oUi)
|
||||
{
|
||||
if (oToFolder && oUi && oUi.helper)
|
||||
{
|
||||
|
|
@ -241,34 +241,34 @@
|
|||
|
||||
if (Utils.isNormal(sFromFolderFullNameRaw) && '' !== sFromFolderFullNameRaw && Utils.isArray(aUids))
|
||||
{
|
||||
require('App:RainLoop').moveMessagesToFolder(sFromFolderFullNameRaw, aUids, oToFolder.fullNameRaw, bCopy);
|
||||
require('App/App').moveMessagesToFolder(sFromFolderFullNameRaw, aUids, oToFolder.fullNameRaw, bCopy);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MailBoxFolderListViewModel.prototype.composeClick = function ()
|
||||
FolderListMailBoxAppView.prototype.composeClick = function ()
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:Compose'));
|
||||
kn.showScreenPopup(require('View/Popup/Compose'));
|
||||
};
|
||||
|
||||
MailBoxFolderListViewModel.prototype.createFolder = function ()
|
||||
FolderListMailBoxAppView.prototype.createFolder = function ()
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:FolderCreate'));
|
||||
kn.showScreenPopup(require('View/Popup/FolderCreate'));
|
||||
};
|
||||
|
||||
MailBoxFolderListViewModel.prototype.configureFolders = function ()
|
||||
FolderListMailBoxAppView.prototype.configureFolders = function ()
|
||||
{
|
||||
kn.setHash(LinkBuilder.settings('folders'));
|
||||
};
|
||||
|
||||
MailBoxFolderListViewModel.prototype.contactsClick = function ()
|
||||
FolderListMailBoxAppView.prototype.contactsClick = function ()
|
||||
{
|
||||
if (this.allowContacts)
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:Contacts'));
|
||||
kn.showScreenPopup(require('View/Popup/Contacts'));
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = MailBoxFolderListViewModel;
|
||||
module.exports = FolderListMailBoxAppView;
|
||||
|
||||
}());
|
||||
|
|
@ -19,22 +19,22 @@
|
|||
Events = require('Common/Events'),
|
||||
Selector = require('Common/Selector'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Cache = require('Storage:RainLoop:Cache'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Cache = require('Storage/App/Cache'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function MailBoxMessageListViewModel()
|
||||
function MessageListMailBoxAppView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Right', 'MailMessageList');
|
||||
AbstractView.call(this, 'Right', 'MailMessageList');
|
||||
|
||||
this.sLastUid = null;
|
||||
this.bPrefetch = false;
|
||||
|
|
@ -168,40 +168,40 @@
|
|||
this.canBeMoved = this.hasCheckedOrSelectedLines;
|
||||
|
||||
this.clearCommand = Utils.createCommand(this, function () {
|
||||
kn.showScreenPopup(require('View:Popup:FolderClear'), [Data.currentFolder()]);
|
||||
kn.showScreenPopup(require('View/Popup/FolderClear'), [Data.currentFolder()]);
|
||||
});
|
||||
|
||||
this.multyForwardCommand = Utils.createCommand(this, function () {
|
||||
kn.showScreenPopup(require('View:Popup:Compose'), [
|
||||
kn.showScreenPopup(require('View/Popup/Compose'), [
|
||||
Enums.ComposeType.ForwardAsAttachment, Data.messageListCheckedOrSelected()]);
|
||||
}, this.canBeMoved);
|
||||
|
||||
this.deleteWithoutMoveCommand = Utils.createCommand(this, function () {
|
||||
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||
Data.currentFolderFullNameRaw(),
|
||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), false);
|
||||
}, this.canBeMoved);
|
||||
|
||||
this.deleteCommand = Utils.createCommand(this, function () {
|
||||
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||
Data.currentFolderFullNameRaw(),
|
||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
||||
}, this.canBeMoved);
|
||||
|
||||
this.archiveCommand = Utils.createCommand(this, function () {
|
||||
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Archive,
|
||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Archive,
|
||||
Data.currentFolderFullNameRaw(),
|
||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
||||
}, this.canBeMoved);
|
||||
|
||||
this.spamCommand = Utils.createCommand(this, function () {
|
||||
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Spam,
|
||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Spam,
|
||||
Data.currentFolderFullNameRaw(),
|
||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
||||
}, this.canBeMoved);
|
||||
|
||||
this.notSpamCommand = Utils.createCommand(this, function () {
|
||||
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.NotSpam,
|
||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.NotSpam,
|
||||
Data.currentFolderFullNameRaw(),
|
||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
||||
}, this.canBeMoved);
|
||||
|
|
@ -211,7 +211,7 @@
|
|||
this.reloadCommand = Utils.createCommand(this, function () {
|
||||
if (!Data.messageListCompleteLoadingThrottle())
|
||||
{
|
||||
require('App:RainLoop').reloadMessageList(false, true);
|
||||
require('App/App').reloadMessageList(false, true);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -265,15 +265,15 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:RainLoop:MailBoxMessageList', 'MailBoxMessageListViewModel'], MailBoxMessageListViewModel);
|
||||
_.extend(MailBoxMessageListViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/App/MailBox/MessageList', 'MailBoxMessageListViewModel'], MessageListMailBoxAppView);
|
||||
_.extend(MessageListMailBoxAppView.prototype, AbstractView.prototype);
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
MailBoxMessageListViewModel.prototype.emptySubjectValue = '';
|
||||
MessageListMailBoxAppView.prototype.emptySubjectValue = '';
|
||||
|
||||
MailBoxMessageListViewModel.prototype.searchEnterAction = function ()
|
||||
MessageListMailBoxAppView.prototype.searchEnterAction = function ()
|
||||
{
|
||||
this.mainMessageListSearch(this.sLastSearchValue);
|
||||
this.inputMessageListSearchFocus(false);
|
||||
|
|
@ -282,13 +282,13 @@
|
|||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
MailBoxMessageListViewModel.prototype.printableMessageCountForDeletion = function ()
|
||||
MessageListMailBoxAppView.prototype.printableMessageCountForDeletion = function ()
|
||||
{
|
||||
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
|
||||
return 1 < iCnt ? ' (' + (100 > iCnt ? iCnt : '99+') + ')' : '';
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.cancelSearch = function ()
|
||||
MessageListMailBoxAppView.prototype.cancelSearch = function ()
|
||||
{
|
||||
this.mainMessageListSearch('');
|
||||
this.inputMessageListSearchFocus(false);
|
||||
|
|
@ -299,11 +299,11 @@
|
|||
* @param {boolean} bCopy
|
||||
* @return {boolean}
|
||||
*/
|
||||
MailBoxMessageListViewModel.prototype.moveSelectedMessagesToFolder = function (sToFolderFullNameRaw, bCopy)
|
||||
MessageListMailBoxAppView.prototype.moveSelectedMessagesToFolder = function (sToFolderFullNameRaw, bCopy)
|
||||
{
|
||||
if (this.canBeMoved())
|
||||
{
|
||||
require('App:RainLoop').moveMessagesToFolder(
|
||||
require('App/App').moveMessagesToFolder(
|
||||
Data.currentFolderFullNameRaw(),
|
||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), sToFolderFullNameRaw, bCopy);
|
||||
}
|
||||
|
|
@ -311,7 +311,7 @@
|
|||
return false;
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.dragAndDronHelper = function (oMessageListItem)
|
||||
MessageListMailBoxAppView.prototype.dragAndDronHelper = function (oMessageListItem)
|
||||
{
|
||||
if (oMessageListItem)
|
||||
{
|
||||
|
|
@ -342,7 +342,7 @@
|
|||
* @param {AjaxJsonDefaultResponse} oData
|
||||
* @param {boolean} bCached
|
||||
*/
|
||||
MailBoxMessageListViewModel.prototype.onMessageResponse = function (sResult, oData, bCached)
|
||||
MessageListMailBoxAppView.prototype.onMessageResponse = function (sResult, oData, bCached)
|
||||
{
|
||||
Data.hideMessageBodies();
|
||||
Data.messageLoading(false);
|
||||
|
|
@ -365,7 +365,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.populateMessageBody = function (oMessage)
|
||||
MessageListMailBoxAppView.prototype.populateMessageBody = function (oMessage)
|
||||
{
|
||||
if (oMessage)
|
||||
{
|
||||
|
|
@ -385,7 +385,7 @@
|
|||
* @param {number} iSetAction
|
||||
* @param {Array=} aMessages = null
|
||||
*/
|
||||
MailBoxMessageListViewModel.prototype.setAction = function (sFolderFullNameRaw, iSetAction, aMessages)
|
||||
MessageListMailBoxAppView.prototype.setAction = function (sFolderFullNameRaw, iSetAction, aMessages)
|
||||
{
|
||||
var
|
||||
aUids = [],
|
||||
|
|
@ -458,7 +458,7 @@
|
|||
break;
|
||||
}
|
||||
|
||||
require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -466,7 +466,7 @@
|
|||
* @param {string} sFolderFullNameRaw
|
||||
* @param {number} iSetAction
|
||||
*/
|
||||
MailBoxMessageListViewModel.prototype.setActionForAll = function (sFolderFullNameRaw, iSetAction)
|
||||
MessageListMailBoxAppView.prototype.setActionForAll = function (sFolderFullNameRaw, iSetAction)
|
||||
{
|
||||
var
|
||||
oFolder = null,
|
||||
|
|
@ -509,37 +509,37 @@
|
|||
break;
|
||||
}
|
||||
|
||||
require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.listSetSeen = function ()
|
||||
MessageListMailBoxAppView.prototype.listSetSeen = function ()
|
||||
{
|
||||
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetSeen, Data.messageListCheckedOrSelected());
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.listSetAllSeen = function ()
|
||||
MessageListMailBoxAppView.prototype.listSetAllSeen = function ()
|
||||
{
|
||||
this.setActionForAll(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetSeen);
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.listUnsetSeen = function ()
|
||||
MessageListMailBoxAppView.prototype.listUnsetSeen = function ()
|
||||
{
|
||||
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.UnsetSeen, Data.messageListCheckedOrSelected());
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.listSetFlags = function ()
|
||||
MessageListMailBoxAppView.prototype.listSetFlags = function ()
|
||||
{
|
||||
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetFlag, Data.messageListCheckedOrSelected());
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.listUnsetFlags = function ()
|
||||
MessageListMailBoxAppView.prototype.listUnsetFlags = function ()
|
||||
{
|
||||
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.UnsetFlag, Data.messageListCheckedOrSelected());
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.flagMessages = function (oCurrentMessage)
|
||||
MessageListMailBoxAppView.prototype.flagMessages = function (oCurrentMessage)
|
||||
{
|
||||
var
|
||||
aChecked = this.messageListCheckedOrSelected(),
|
||||
|
|
@ -568,7 +568,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.flagMessagesFast = function (bFlag)
|
||||
MessageListMailBoxAppView.prototype.flagMessagesFast = function (bFlag)
|
||||
{
|
||||
var
|
||||
aChecked = this.messageListCheckedOrSelected(),
|
||||
|
|
@ -594,7 +594,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.seenMessagesFast = function (bSeen)
|
||||
MessageListMailBoxAppView.prototype.seenMessagesFast = function (bSeen)
|
||||
{
|
||||
var
|
||||
aChecked = this.messageListCheckedOrSelected(),
|
||||
|
|
@ -620,7 +620,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.onBuild = function (oDom)
|
||||
MessageListMailBoxAppView.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var self = this;
|
||||
|
||||
|
|
@ -653,7 +653,7 @@
|
|||
oMessage.lastInCollapsedThreadLoading(true);
|
||||
oMessage.lastInCollapsedThread(!oMessage.lastInCollapsedThread());
|
||||
|
||||
require('App:RainLoop').reloadMessageList();
|
||||
require('App/App').reloadMessageList();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
@ -700,7 +700,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.initShortcuts = function ()
|
||||
MessageListMailBoxAppView.prototype.initShortcuts = function ()
|
||||
{
|
||||
var self = this;
|
||||
|
||||
|
|
@ -749,7 +749,7 @@
|
|||
|
||||
// write/compose (open compose popup)
|
||||
key('w,c', [Enums.KeyState.MessageList, Enums.KeyState.MessageView], function () {
|
||||
kn.showScreenPopup(require('View:Popup:Compose'));
|
||||
kn.showScreenPopup(require('View/Popup/Compose'));
|
||||
return false;
|
||||
});
|
||||
|
||||
|
|
@ -822,7 +822,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.prefetchNextTick = function ()
|
||||
MessageListMailBoxAppView.prototype.prefetchNextTick = function ()
|
||||
{
|
||||
if (!this.bPrefetch && !ifvisible.now() && this.viewModelVisibility())
|
||||
{
|
||||
|
|
@ -857,17 +857,17 @@
|
|||
}
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.composeClick = function ()
|
||||
MessageListMailBoxAppView.prototype.composeClick = function ()
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:Compose'));
|
||||
kn.showScreenPopup(require('View/Popup/Compose'));
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.advancedSearchClick = function ()
|
||||
MessageListMailBoxAppView.prototype.advancedSearchClick = function ()
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:AdvancedSearch'));
|
||||
kn.showScreenPopup(require('View/Popup/AdvancedSearch'));
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.quotaTooltip = function ()
|
||||
MessageListMailBoxAppView.prototype.quotaTooltip = function ()
|
||||
{
|
||||
return Utils.i18n('MESSAGE_LIST/QUOTA_SIZE', {
|
||||
'SIZE': Utils.friendlySize(this.userUsageSize()),
|
||||
|
|
@ -876,7 +876,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
MailBoxMessageListViewModel.prototype.initUploaderForAppend = function ()
|
||||
MessageListMailBoxAppView.prototype.initUploaderForAppend = function ()
|
||||
{
|
||||
if (!Settings.settingsGet('AllowAppendMessage') || !this.dragOverArea())
|
||||
{
|
||||
|
|
@ -923,13 +923,13 @@
|
|||
return false;
|
||||
}, this))
|
||||
.on('onComplete', _.bind(function () {
|
||||
require('App:RainLoop').reloadMessageList(true, true);
|
||||
require('App/App').reloadMessageList(true, true);
|
||||
}, this))
|
||||
;
|
||||
|
||||
return !!oJua;
|
||||
};
|
||||
|
||||
module.exports = MailBoxMessageListViewModel;
|
||||
module.exports = MessageListMailBoxAppView;
|
||||
|
||||
}());
|
||||
|
|
@ -15,21 +15,21 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Events = require('Common/Events'),
|
||||
|
||||
Cache = require('Storage:RainLoop:Cache'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Cache = require('Storage/App/Cache'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function MailBoxMessageViewViewModel()
|
||||
function MessageViewMailBoxAppView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Right', 'MailMessageView');
|
||||
AbstractView.call(this, 'Right', 'MailMessageView');
|
||||
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
this.deleteCommand = Utils.createCommand(this, function () {
|
||||
if (this.message())
|
||||
{
|
||||
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||
this.message().folderFullNameRaw,
|
||||
[this.message().uid], true);
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@
|
|||
this.deleteWithoutMoveCommand = Utils.createCommand(this, function () {
|
||||
if (this.message())
|
||||
{
|
||||
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||
Data.currentFolderFullNameRaw(),
|
||||
[this.message().uid], false);
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@
|
|||
this.archiveCommand = Utils.createCommand(this, function () {
|
||||
if (this.message())
|
||||
{
|
||||
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Archive,
|
||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Archive,
|
||||
this.message().folderFullNameRaw,
|
||||
[this.message().uid], true);
|
||||
}
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
this.spamCommand = Utils.createCommand(this, function () {
|
||||
if (this.message())
|
||||
{
|
||||
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.Spam,
|
||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Spam,
|
||||
this.message().folderFullNameRaw,
|
||||
[this.message().uid], true);
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@
|
|||
this.notSpamCommand = Utils.createCommand(this, function () {
|
||||
if (this.message())
|
||||
{
|
||||
require('App:RainLoop').deleteMessagesFromFolder(Enums.FolderType.NotSpam,
|
||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.NotSpam,
|
||||
this.message().folderFullNameRaw,
|
||||
[this.message().uid], true);
|
||||
}
|
||||
|
|
@ -248,25 +248,25 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:RainLoop:MailBoxMessageView', 'MailBoxMessageViewViewModel'], MailBoxMessageViewViewModel);
|
||||
_.extend(MailBoxMessageViewViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/App/MailBox/MessageView', 'MailBoxMessageViewViewModel'], MessageViewMailBoxAppView);
|
||||
_.extend(MessageViewMailBoxAppView.prototype, AbstractView.prototype);
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.isPgpActionVisible = function ()
|
||||
MessageViewMailBoxAppView.prototype.isPgpActionVisible = function ()
|
||||
{
|
||||
return Enums.SignedVerifyStatus.Success !== this.viewPgpSignedVerifyStatus();
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.isPgpStatusVerifyVisible = function ()
|
||||
MessageViewMailBoxAppView.prototype.isPgpStatusVerifyVisible = function ()
|
||||
{
|
||||
return Enums.SignedVerifyStatus.None !== this.viewPgpSignedVerifyStatus();
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.isPgpStatusVerifySuccess = function ()
|
||||
MessageViewMailBoxAppView.prototype.isPgpStatusVerifySuccess = function ()
|
||||
{
|
||||
return Enums.SignedVerifyStatus.Success === this.viewPgpSignedVerifyStatus();
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.pgpStatusVerifyMessage = function ()
|
||||
MessageViewMailBoxAppView.prototype.pgpStatusVerifyMessage = function ()
|
||||
{
|
||||
var sResult = '';
|
||||
switch (this.viewPgpSignedVerifyStatus())
|
||||
|
|
@ -293,19 +293,19 @@
|
|||
return sResult;
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.fullScreen = function ()
|
||||
MessageViewMailBoxAppView.prototype.fullScreen = function ()
|
||||
{
|
||||
this.fullScreenMode(true);
|
||||
Utils.windowResize();
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.unFullScreen = function ()
|
||||
MessageViewMailBoxAppView.prototype.unFullScreen = function ()
|
||||
{
|
||||
this.fullScreenMode(false);
|
||||
Utils.windowResize();
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.toggleFullScreen = function ()
|
||||
MessageViewMailBoxAppView.prototype.toggleFullScreen = function ()
|
||||
{
|
||||
Utils.removeSelection();
|
||||
|
||||
|
|
@ -316,12 +316,12 @@
|
|||
/**
|
||||
* @param {string} sType
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.replyOrforward = function (sType)
|
||||
MessageViewMailBoxAppView.prototype.replyOrforward = function (sType)
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:Compose'), [sType, Data.message()]);
|
||||
kn.showScreenPopup(require('View/Popup/Compose'), [sType, Data.message()]);
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.onBuild = function (oDom)
|
||||
MessageViewMailBoxAppView.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var self = this;
|
||||
this.fullScreenMode.subscribe(function (bValue) {
|
||||
|
|
@ -354,7 +354,7 @@
|
|||
oDom
|
||||
.on('click', 'a', function (oEvent) {
|
||||
// setup maito protocol
|
||||
return !(!!oEvent && 3 !== oEvent['which'] && Utils.mailToHelper($(this).attr('href'), require('View:Popup:Compose')));
|
||||
return !(!!oEvent && 3 !== oEvent['which'] && Utils.mailToHelper($(this).attr('href'), require('View/Popup/Compose')));
|
||||
})
|
||||
.on('click', '.attachmentsPlace .attachmentPreview', function (oEvent) {
|
||||
if (oEvent && oEvent.stopPropagation)
|
||||
|
|
@ -370,7 +370,7 @@
|
|||
|
||||
if (oAttachment && oAttachment.download)
|
||||
{
|
||||
require('App:RainLoop').download(oAttachment.linkDownload());
|
||||
require('App/App').download(oAttachment.linkDownload());
|
||||
}
|
||||
})
|
||||
;
|
||||
|
|
@ -408,7 +408,7 @@
|
|||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.escShortcuts = function ()
|
||||
MessageViewMailBoxAppView.prototype.escShortcuts = function ()
|
||||
{
|
||||
if (this.viewModelVisibility() && this.message())
|
||||
{
|
||||
|
|
@ -429,7 +429,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.initShortcuts = function ()
|
||||
MessageViewMailBoxAppView.prototype.initShortcuts = function ()
|
||||
{
|
||||
var
|
||||
self = this
|
||||
|
|
@ -570,7 +570,7 @@
|
|||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.isDraftFolder = function ()
|
||||
MessageViewMailBoxAppView.prototype.isDraftFolder = function ()
|
||||
{
|
||||
return Data.message() && Data.draftFolder() === Data.message().folderFullNameRaw;
|
||||
};
|
||||
|
|
@ -578,7 +578,7 @@
|
|||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.isSentFolder = function ()
|
||||
MessageViewMailBoxAppView.prototype.isSentFolder = function ()
|
||||
{
|
||||
return Data.message() && Data.sentFolder() === Data.message().folderFullNameRaw;
|
||||
};
|
||||
|
|
@ -586,7 +586,7 @@
|
|||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.isSpamFolder = function ()
|
||||
MessageViewMailBoxAppView.prototype.isSpamFolder = function ()
|
||||
{
|
||||
return Data.message() && Data.spamFolder() === Data.message().folderFullNameRaw;
|
||||
};
|
||||
|
|
@ -594,7 +594,7 @@
|
|||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.isSpamDisabled = function ()
|
||||
MessageViewMailBoxAppView.prototype.isSpamDisabled = function ()
|
||||
{
|
||||
return Data.message() && Data.spamFolder() === Consts.Values.UnuseOptionValue;
|
||||
};
|
||||
|
|
@ -602,7 +602,7 @@
|
|||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.isArchiveFolder = function ()
|
||||
MessageViewMailBoxAppView.prototype.isArchiveFolder = function ()
|
||||
{
|
||||
return Data.message() && Data.archiveFolder() === Data.message().folderFullNameRaw;
|
||||
};
|
||||
|
|
@ -610,7 +610,7 @@
|
|||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.isArchiveDisabled = function ()
|
||||
MessageViewMailBoxAppView.prototype.isArchiveDisabled = function ()
|
||||
{
|
||||
return Data.message() && Data.archiveFolder() === Consts.Values.UnuseOptionValue;
|
||||
};
|
||||
|
|
@ -618,25 +618,25 @@
|
|||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.isDraftOrSentFolder = function ()
|
||||
MessageViewMailBoxAppView.prototype.isDraftOrSentFolder = function ()
|
||||
{
|
||||
return this.isDraftFolder() || this.isSentFolder();
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.composeClick = function ()
|
||||
MessageViewMailBoxAppView.prototype.composeClick = function ()
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:Compose'));
|
||||
kn.showScreenPopup(require('View/Popup/Compose'));
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.editMessage = function ()
|
||||
MessageViewMailBoxAppView.prototype.editMessage = function ()
|
||||
{
|
||||
if (Data.message())
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:Compose'), [Enums.ComposeType.Draft, Data.message()]);
|
||||
kn.showScreenPopup(require('View/Popup/Compose'), [Enums.ComposeType.Draft, Data.message()]);
|
||||
}
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.scrollMessageToTop = function ()
|
||||
MessageViewMailBoxAppView.prototype.scrollMessageToTop = function ()
|
||||
{
|
||||
if (this.oMessageScrollerDom)
|
||||
{
|
||||
|
|
@ -645,7 +645,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
MailBoxMessageViewViewModel.prototype.scrollMessageToLeft = function ()
|
||||
MessageViewMailBoxAppView.prototype.scrollMessageToLeft = function ()
|
||||
{
|
||||
if (this.oMessageScrollerDom)
|
||||
{
|
||||
|
|
@ -657,7 +657,7 @@
|
|||
/**
|
||||
* @param {MessageModel} oMessage
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.showImages = function (oMessage)
|
||||
MessageViewMailBoxAppView.prototype.showImages = function (oMessage)
|
||||
{
|
||||
if (oMessage && oMessage.showExternalImages)
|
||||
{
|
||||
|
|
@ -668,7 +668,7 @@
|
|||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.printableCheckedMessageCount = function ()
|
||||
MessageViewMailBoxAppView.prototype.printableCheckedMessageCount = function ()
|
||||
{
|
||||
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
|
||||
return 0 < iCnt ? (100 > iCnt ? iCnt : '99+') : '';
|
||||
|
|
@ -678,7 +678,7 @@
|
|||
/**
|
||||
* @param {MessageModel} oMessage
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.verifyPgpSignedClearMessage = function (oMessage)
|
||||
MessageViewMailBoxAppView.prototype.verifyPgpSignedClearMessage = function (oMessage)
|
||||
{
|
||||
if (oMessage)
|
||||
{
|
||||
|
|
@ -689,7 +689,7 @@
|
|||
/**
|
||||
* @param {MessageModel} oMessage
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.decryptPgpEncryptedMessage = function (oMessage)
|
||||
MessageViewMailBoxAppView.prototype.decryptPgpEncryptedMessage = function (oMessage)
|
||||
{
|
||||
if (oMessage)
|
||||
{
|
||||
|
|
@ -700,7 +700,7 @@
|
|||
/**
|
||||
* @param {MessageModel} oMessage
|
||||
*/
|
||||
MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage)
|
||||
MessageViewMailBoxAppView.prototype.readReceipt = function (oMessage)
|
||||
{
|
||||
if (oMessage && '' !== oMessage.readReceipt())
|
||||
{
|
||||
|
|
@ -713,10 +713,10 @@
|
|||
|
||||
Cache.storeMessageFlagsToCache(oMessage);
|
||||
|
||||
require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = MailBoxMessageViewViewModel;
|
||||
module.exports = MessageViewMailBoxAppView;
|
||||
|
||||
}());
|
||||
28
dev/View/App/MailBox/SystemDropDown.js
Normal file
28
dev/View/App/MailBox/SystemDropDown.js
Normal 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;
|
||||
|
||||
}());
|
||||
48
dev/View/App/Settings/Menu.js
Normal file
48
dev/View/App/Settings/Menu.js
Normal 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;
|
||||
|
||||
}());
|
||||
53
dev/View/App/Settings/Pane.js
Normal file
53
dev/View/App/Settings/Pane.js
Normal 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;
|
||||
|
||||
}());
|
||||
28
dev/View/App/Settings/SystemDropDown.js
Normal file
28
dev/View/App/Settings/SystemDropDown.js
Normal 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;
|
||||
|
||||
}());
|
||||
|
|
@ -10,21 +10,21 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:Admin:Data'),
|
||||
Remote = require('Storage:Admin:Remote'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/Admin/Data'),
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsActivateViewModel()
|
||||
function ActivatePopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsActivate');
|
||||
AbstractView.call(this, 'Popups', 'PopupsActivate');
|
||||
|
||||
var self = this;
|
||||
|
||||
|
|
@ -104,10 +104,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:Activate', 'PopupsActivateViewModel'], PopupsActivateViewModel);
|
||||
_.extend(PopupsActivateViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/Activate', 'PopupsActivateViewModel'], ActivatePopupView);
|
||||
_.extend(ActivatePopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsActivateViewModel.prototype.onShow = function ()
|
||||
ActivatePopupView.prototype.onShow = function ()
|
||||
{
|
||||
this.domain(Settings.settingsGet('AdminDomain'));
|
||||
if (!this.activateProcess())
|
||||
|
|
@ -119,7 +119,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsActivateViewModel.prototype.onFocus = function ()
|
||||
ActivatePopupView.prototype.onFocus = function ()
|
||||
{
|
||||
if (!this.activateProcess())
|
||||
{
|
||||
|
|
@ -130,12 +130,12 @@
|
|||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
PopupsActivateViewModel.prototype.validateSubscriptionKey = function ()
|
||||
ActivatePopupView.prototype.validateSubscriptionKey = function ()
|
||||
{
|
||||
var sValue = this.key();
|
||||
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
|
||||
};
|
||||
|
||||
module.exports = PopupsActivateViewModel;
|
||||
module.exports = ActivatePopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -10,19 +10,19 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsAddAccountViewModel()
|
||||
function AddAccountPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddAccount');
|
||||
AbstractView.call(this, 'Popups', 'PopupsAddAccount');
|
||||
|
||||
this.email = ko.observable('');
|
||||
this.password = ko.observable('');
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
{
|
||||
if (oData.Result)
|
||||
{
|
||||
require('App:RainLoop').accountsAndIdentities();
|
||||
require('App/App').accountsAndIdentities();
|
||||
this.cancelCommand();
|
||||
}
|
||||
else if (oData.ErrorCode)
|
||||
|
|
@ -86,10 +86,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:AddAccount', 'PopupsAddAccountViewModel'], PopupsAddAccountViewModel);
|
||||
_.extend(PopupsAddAccountViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/AddAccount', 'PopupsAddAccountViewModel'], AddAccountPopupView);
|
||||
_.extend(AddAccountPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsAddAccountViewModel.prototype.clearPopup = function ()
|
||||
AddAccountPopupView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.email('');
|
||||
this.password('');
|
||||
|
|
@ -101,16 +101,16 @@
|
|||
this.submitError('');
|
||||
};
|
||||
|
||||
PopupsAddAccountViewModel.prototype.onShow = function ()
|
||||
AddAccountPopupView.prototype.onShow = function ()
|
||||
{
|
||||
this.clearPopup();
|
||||
};
|
||||
|
||||
PopupsAddAccountViewModel.prototype.onFocus = function ()
|
||||
AddAccountPopupView.prototype.onFocus = function ()
|
||||
{
|
||||
this.emailFocus(true);
|
||||
};
|
||||
|
||||
module.exports = PopupsAddAccountViewModel;
|
||||
module.exports = AddAccountPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -9,19 +9,19 @@
|
|||
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Data = require('Storage/App/Data'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsAddOpenPgpKeyViewModel()
|
||||
function AddOpenPgpKeyPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAddOpenPgpKey');
|
||||
AbstractView.call(this, 'Popups', 'PopupsAddOpenPgpKey');
|
||||
|
||||
this.key = ko.observable('');
|
||||
this.key.error = ko.observable(false);
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
|
||||
oOpenpgpKeyring.store();
|
||||
|
||||
require('App:RainLoop').reloadOpenPgpKeys();
|
||||
require('App/App').reloadOpenPgpKeys();
|
||||
Utils.delegateRun(this, 'cancelCommand');
|
||||
|
||||
return true;
|
||||
|
|
@ -86,25 +86,25 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:AddOpenPgpKey', 'PopupsAddOpenPgpKeyViewModel'], PopupsAddOpenPgpKeyViewModel);
|
||||
_.extend(PopupsAddOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/AddOpenPgpKey', 'PopupsAddOpenPgpKeyViewModel'], AddOpenPgpKeyPopupView);
|
||||
_.extend(AddOpenPgpKeyPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsAddOpenPgpKeyViewModel.prototype.clearPopup = function ()
|
||||
AddOpenPgpKeyPopupView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.key('');
|
||||
this.key.error(false);
|
||||
};
|
||||
|
||||
PopupsAddOpenPgpKeyViewModel.prototype.onShow = function ()
|
||||
AddOpenPgpKeyPopupView.prototype.onShow = function ()
|
||||
{
|
||||
this.clearPopup();
|
||||
};
|
||||
|
||||
PopupsAddOpenPgpKeyViewModel.prototype.onFocus = function ()
|
||||
AddOpenPgpKeyPopupView.prototype.onFocus = function ()
|
||||
{
|
||||
this.key.focus(true);
|
||||
};
|
||||
|
||||
module.exports = PopupsAddOpenPgpKeyViewModel;
|
||||
module.exports = AddOpenPgpKeyPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -10,19 +10,19 @@
|
|||
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Data = require('Storage/App/Data'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsAdvancedSearchViewModel()
|
||||
function AdvancedSearchPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAdvancedSearch');
|
||||
AbstractView.call(this, 'Popups', 'PopupsAdvancedSearch');
|
||||
|
||||
this.fromFocus = ko.observable(false);
|
||||
|
||||
|
|
@ -50,10 +50,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:AdvancedSearch', 'PopupsAdvancedSearchViewModel'], PopupsAdvancedSearchViewModel);
|
||||
_.extend(PopupsAdvancedSearchViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/AdvancedSearch', 'PopupsAdvancedSearchViewModel'], AdvancedSearchPopupView);
|
||||
_.extend(AdvancedSearchPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsAdvancedSearchViewModel.prototype.buildSearchStringValue = function (sValue)
|
||||
AdvancedSearchPopupView.prototype.buildSearchStringValue = function (sValue)
|
||||
{
|
||||
if (-1 < sValue.indexOf(' '))
|
||||
{
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
return sValue;
|
||||
};
|
||||
|
||||
PopupsAdvancedSearchViewModel.prototype.buildSearchString = function ()
|
||||
AdvancedSearchPopupView.prototype.buildSearchString = function ()
|
||||
{
|
||||
var
|
||||
aResult = [],
|
||||
|
|
@ -128,7 +128,7 @@
|
|||
return Utils.trim(aResult.join(' '));
|
||||
};
|
||||
|
||||
PopupsAdvancedSearchViewModel.prototype.clearPopup = function ()
|
||||
AdvancedSearchPopupView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.from('');
|
||||
this.to('');
|
||||
|
|
@ -143,16 +143,16 @@
|
|||
this.fromFocus(true);
|
||||
};
|
||||
|
||||
PopupsAdvancedSearchViewModel.prototype.onShow = function ()
|
||||
AdvancedSearchPopupView.prototype.onShow = function ()
|
||||
{
|
||||
this.clearPopup();
|
||||
};
|
||||
|
||||
PopupsAdvancedSearchViewModel.prototype.onFocus = function ()
|
||||
AdvancedSearchPopupView.prototype.onFocus = function ()
|
||||
{
|
||||
this.fromFocus(true);
|
||||
};
|
||||
|
||||
module.exports = PopupsAdvancedSearchViewModel;
|
||||
module.exports = AdvancedSearchPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -11,17 +11,17 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsAskViewModel()
|
||||
function AskPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsAsk');
|
||||
AbstractView.call(this, 'Popups', 'PopupsAsk');
|
||||
|
||||
this.askDesc = ko.observable('');
|
||||
this.yesButton = ko.observable('');
|
||||
|
|
@ -39,10 +39,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:Ask', 'PopupsAskViewModel'], PopupsAskViewModel);
|
||||
_.extend(PopupsAskViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/Ask', 'PopupsAskViewModel'], AskPopupView);
|
||||
_.extend(AskPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsAskViewModel.prototype.clearPopup = function ()
|
||||
AskPopupView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.askDesc('');
|
||||
this.yesButton(Utils.i18n('POPUPS_ASK/BUTTON_YES'));
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
this.fNoAction = null;
|
||||
};
|
||||
|
||||
PopupsAskViewModel.prototype.yesClick = function ()
|
||||
AskPopupView.prototype.yesClick = function ()
|
||||
{
|
||||
this.cancelCommand();
|
||||
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsAskViewModel.prototype.noClick = function ()
|
||||
AskPopupView.prototype.noClick = function ()
|
||||
{
|
||||
this.cancelCommand();
|
||||
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
* @param {string=} sYesButton
|
||||
* @param {string=} sNoButton
|
||||
*/
|
||||
PopupsAskViewModel.prototype.onShow = function (sAskDesc, fYesFunc, fNoFunc, sYesButton, sNoButton)
|
||||
AskPopupView.prototype.onShow = function (sAskDesc, fYesFunc, fNoFunc, sYesButton, sNoButton)
|
||||
{
|
||||
this.clearPopup();
|
||||
|
||||
|
|
@ -101,12 +101,12 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsAskViewModel.prototype.onFocus = function ()
|
||||
AskPopupView.prototype.onFocus = function ()
|
||||
{
|
||||
this.yesFocus(true);
|
||||
};
|
||||
|
||||
PopupsAskViewModel.prototype.onBuild = function ()
|
||||
AskPopupView.prototype.onBuild = function ()
|
||||
{
|
||||
key('tab, shift+tab, right, left', Enums.KeyState.PopupAsk, _.bind(function () {
|
||||
if (this.yesFocus())
|
||||
|
|
@ -126,6 +126,6 @@
|
|||
}, this));
|
||||
};
|
||||
|
||||
module.exports = PopupsAskViewModel;
|
||||
module.exports = AskPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -20,24 +20,24 @@
|
|||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
HtmlEditor = require('Common/HtmlEditor'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Cache = require('Storage:RainLoop:Cache'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Cache = require('Storage/App/Cache'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
ComposeAttachmentModel = require('Model/ComposeAttachment'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsComposeViewModel()
|
||||
function ComposePopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsCompose');
|
||||
AbstractView.call(this, 'Popups', 'PopupsCompose');
|
||||
|
||||
this.oEditor = null;
|
||||
this.aDraftInfo = null;
|
||||
|
|
@ -211,8 +211,8 @@
|
|||
|
||||
this.deleteCommand = Utils.createCommand(this, function () {
|
||||
|
||||
require('App:RainLoop').deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]);
|
||||
kn.hideScreenPopup(PopupsComposeViewModel);
|
||||
require('App/App').deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]);
|
||||
kn.hideScreenPopup(ComposePopupView);
|
||||
|
||||
}, function () {
|
||||
return this.isDraftFolderMessage();
|
||||
|
|
@ -248,7 +248,7 @@
|
|||
|
||||
if ('' === sSentFolder)
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:FolderSystem'), [Enums.SetSystemFoldersNotification.Sent]);
|
||||
kn.showScreenPopup(require('View/Popup/FolderSystem'), [Enums.SetSystemFoldersNotification.Sent]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -270,7 +270,7 @@
|
|||
}
|
||||
|
||||
Cache.setMessageFlagsToCache(this.aDraftInfo[2], this.aDraftInfo[1], aFlagsCache);
|
||||
require('App:RainLoop').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
Cache.setFolderHash(this.aDraftInfo[2], '');
|
||||
}
|
||||
}
|
||||
|
|
@ -306,7 +306,7 @@
|
|||
|
||||
if (Data.draftFolderNotEnabled())
|
||||
{
|
||||
kn.showScreenPopup(require('View:Popup:FolderSystem'), [Enums.SetSystemFoldersNotification.Draft]);
|
||||
kn.showScreenPopup(require('View/Popup/FolderSystem'), [Enums.SetSystemFoldersNotification.Draft]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -403,24 +403,24 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:Compose', 'PopupsComposeViewModel'], PopupsComposeViewModel);
|
||||
_.extend(PopupsComposeViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/Compose', 'PopupsComposeViewModel'], ComposePopupView);
|
||||
_.extend(ComposePopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsComposeViewModel.prototype.emailsSource = function (oData, fResponse)
|
||||
ComposePopupView.prototype.emailsSource = function (oData, fResponse)
|
||||
{
|
||||
require('App:RainLoop').getAutocomplete(oData.term, function (aData) {
|
||||
require('App/App').getAutocomplete(oData.term, function (aData) {
|
||||
fResponse(_.map(aData, function (oEmailItem) {
|
||||
return oEmailItem.toLine(false);
|
||||
}));
|
||||
});
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.openOpenPgpPopup = function ()
|
||||
ComposePopupView.prototype.openOpenPgpPopup = function ()
|
||||
{
|
||||
if (this.capaOpenPGP() && this.oEditor && !this.oEditor.isHtml())
|
||||
{
|
||||
var self = this;
|
||||
kn.showScreenPopup(require('View:Popup:ComposeOpenPgp'), [
|
||||
kn.showScreenPopup(require('View/Popup/ComposeOpenPgp'), [
|
||||
function (sResult) {
|
||||
self.editor(function (oEditor) {
|
||||
oEditor.setPlain(sResult);
|
||||
|
|
@ -435,7 +435,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.reloadDraftFolder = function ()
|
||||
ComposePopupView.prototype.reloadDraftFolder = function ()
|
||||
{
|
||||
var
|
||||
sDraftFolder = Data.draftFolder()
|
||||
|
|
@ -446,16 +446,16 @@
|
|||
Cache.setFolderHash(sDraftFolder, '');
|
||||
if (Data.currentFolderFullNameRaw() === sDraftFolder)
|
||||
{
|
||||
require('App:RainLoop').reloadMessageList(true);
|
||||
require('App/App').reloadMessageList(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
require('App:RainLoop').folderInformation(sDraftFolder);
|
||||
require('App/App').folderInformation(sDraftFolder);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.findIdentityIdByMessage = function (sComposeType, oMessage)
|
||||
ComposePopupView.prototype.findIdentityIdByMessage = function (sComposeType, oMessage)
|
||||
{
|
||||
var
|
||||
oIDs = {},
|
||||
|
|
@ -511,7 +511,7 @@
|
|||
return sResult;
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.selectIdentity = function (oIdentity)
|
||||
ComposePopupView.prototype.selectIdentity = function (oIdentity)
|
||||
{
|
||||
if (oIdentity)
|
||||
{
|
||||
|
|
@ -524,7 +524,7 @@
|
|||
* @param {boolean=} bHeaderResult = false
|
||||
* @returns {string}
|
||||
*/
|
||||
PopupsComposeViewModel.prototype.formattedFrom = function (bHeaderResult)
|
||||
ComposePopupView.prototype.formattedFrom = function (bHeaderResult)
|
||||
{
|
||||
var
|
||||
sDisplayName = Data.displayName(),
|
||||
|
|
@ -538,7 +538,7 @@
|
|||
;
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.sendMessageResponse = function (sResult, oData)
|
||||
ComposePopupView.prototype.sendMessageResponse = function (sResult, oData)
|
||||
{
|
||||
var
|
||||
bResult = false,
|
||||
|
|
@ -576,7 +576,7 @@
|
|||
this.reloadDraftFolder();
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.saveMessageResponse = function (sResult, oData)
|
||||
ComposePopupView.prototype.saveMessageResponse = function (sResult, oData)
|
||||
{
|
||||
var
|
||||
bResult = false,
|
||||
|
|
@ -630,7 +630,7 @@
|
|||
this.reloadDraftFolder();
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.onHide = function ()
|
||||
ComposePopupView.prototype.onHide = function ()
|
||||
{
|
||||
this.reset();
|
||||
kn.routeOn();
|
||||
|
|
@ -643,7 +643,7 @@
|
|||
* @param {string=} sComposeType
|
||||
* @return {string}
|
||||
*/
|
||||
PopupsComposeViewModel.prototype.convertSignature = function (sSignature, sFrom, sData, sComposeType)
|
||||
ComposePopupView.prototype.convertSignature = function (sSignature, sFrom, sData, sComposeType)
|
||||
{
|
||||
var bHtml = false, bData = false;
|
||||
if ('' !== sSignature)
|
||||
|
|
@ -698,7 +698,7 @@
|
|||
return sSignature;
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.editor = function (fOnInit)
|
||||
ComposePopupView.prototype.editor = function (fOnInit)
|
||||
{
|
||||
if (fOnInit)
|
||||
{
|
||||
|
|
@ -727,7 +727,7 @@
|
|||
* @param {string=} sCustomSubject = null
|
||||
* @param {string=} sCustomPlainText = null
|
||||
*/
|
||||
PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToEmails, sCustomSubject, sCustomPlainText)
|
||||
ComposePopupView.prototype.onShow = function (sType, oMessageOrArray, aToEmails, sCustomSubject, sCustomPlainText)
|
||||
{
|
||||
kn.routeOff();
|
||||
|
||||
|
|
@ -990,7 +990,7 @@
|
|||
this.triggerForResize();
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.onFocus = function ()
|
||||
ComposePopupView.prototype.onFocus = function ()
|
||||
{
|
||||
if ('' === this.to())
|
||||
{
|
||||
|
|
@ -1004,7 +1004,7 @@
|
|||
this.triggerForResize();
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.editorResize = function ()
|
||||
ComposePopupView.prototype.editorResize = function ()
|
||||
{
|
||||
if (this.oEditor)
|
||||
{
|
||||
|
|
@ -1012,11 +1012,11 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.tryToClosePopup = function ()
|
||||
ComposePopupView.prototype.tryToClosePopup = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
PopupsAskViewModel = require('View:Popup:Ask')
|
||||
PopupsAskViewModel = require('View/Popup/Ask')
|
||||
;
|
||||
|
||||
if (!kn.isPopupVisible(PopupsAskViewModel))
|
||||
|
|
@ -1030,7 +1030,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.onBuild = function ()
|
||||
ComposePopupView.prototype.onBuild = function ()
|
||||
{
|
||||
this.initUploader();
|
||||
|
||||
|
|
@ -1087,7 +1087,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.driveCallback = function (sAccessToken, oData)
|
||||
ComposePopupView.prototype.driveCallback = function (sAccessToken, oData)
|
||||
{
|
||||
if (oData && window.XMLHttpRequest && window.google &&
|
||||
oData[window.google.picker.Response.ACTION] === window.google.picker.Action.PICKED &&
|
||||
|
|
@ -1155,7 +1155,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.driveCreatePiker = function (oOauthToken)
|
||||
ComposePopupView.prototype.driveCreatePiker = function (oOauthToken)
|
||||
{
|
||||
if (window.gapi && oOauthToken && oOauthToken.access_token)
|
||||
{
|
||||
|
|
@ -1183,7 +1183,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.driveOpenPopup = function ()
|
||||
ComposePopupView.prototype.driveOpenPopup = function ()
|
||||
{
|
||||
if (window.gapi)
|
||||
{
|
||||
|
|
@ -1238,7 +1238,7 @@
|
|||
* @param {string} sId
|
||||
* @return {?Object}
|
||||
*/
|
||||
PopupsComposeViewModel.prototype.getAttachmentById = function (sId)
|
||||
ComposePopupView.prototype.getAttachmentById = function (sId)
|
||||
{
|
||||
var
|
||||
aAttachments = this.attachments(),
|
||||
|
|
@ -1257,7 +1257,7 @@
|
|||
return null;
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.initUploader = function ()
|
||||
ComposePopupView.prototype.initUploader = function ()
|
||||
{
|
||||
if (this.composeUploaderButton())
|
||||
{
|
||||
|
|
@ -1445,7 +1445,7 @@
|
|||
/**
|
||||
* @return {Object}
|
||||
*/
|
||||
PopupsComposeViewModel.prototype.prepearAttachmentsForSendOrSave = function ()
|
||||
ComposePopupView.prototype.prepearAttachmentsForSendOrSave = function ()
|
||||
{
|
||||
var oResult = {};
|
||||
_.each(this.attachmentsInReady(), function (oItem) {
|
||||
|
|
@ -1466,7 +1466,7 @@
|
|||
/**
|
||||
* @param {MessageModel} oMessage
|
||||
*/
|
||||
PopupsComposeViewModel.prototype.addMessageAsAttachment = function (oMessage)
|
||||
ComposePopupView.prototype.addMessageAsAttachment = function (oMessage)
|
||||
{
|
||||
if (oMessage)
|
||||
{
|
||||
|
|
@ -1500,7 +1500,7 @@
|
|||
* @param {Object} oDropboxFile
|
||||
* @return {boolean}
|
||||
*/
|
||||
PopupsComposeViewModel.prototype.addDropboxAttachment = function (oDropboxFile)
|
||||
ComposePopupView.prototype.addDropboxAttachment = function (oDropboxFile)
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -1562,7 +1562,7 @@
|
|||
* @param {string} sAccessToken
|
||||
* @return {boolean}
|
||||
*/
|
||||
PopupsComposeViewModel.prototype.addDriveAttachment = function (oDriveFile, sAccessToken)
|
||||
ComposePopupView.prototype.addDriveAttachment = function (oDriveFile, sAccessToken)
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -1624,7 +1624,7 @@
|
|||
* @param {MessageModel} oMessage
|
||||
* @param {string} sType
|
||||
*/
|
||||
PopupsComposeViewModel.prototype.prepearMessageAttachments = function (oMessage, sType)
|
||||
ComposePopupView.prototype.prepearMessageAttachments = function (oMessage, sType)
|
||||
{
|
||||
if (oMessage)
|
||||
{
|
||||
|
|
@ -1687,14 +1687,14 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.removeLinkedAttachments = function ()
|
||||
ComposePopupView.prototype.removeLinkedAttachments = function ()
|
||||
{
|
||||
this.attachments.remove(function (oItem) {
|
||||
return oItem && oItem.isLinked;
|
||||
});
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.setMessageAttachmentFailedDowbloadText = function ()
|
||||
ComposePopupView.prototype.setMessageAttachmentFailedDowbloadText = function ()
|
||||
{
|
||||
_.each(this.attachments(), function(oAttachment) {
|
||||
if (oAttachment && oAttachment.fromMessage)
|
||||
|
|
@ -1712,7 +1712,7 @@
|
|||
* @param {boolean=} bIncludeAttachmentInProgress = true
|
||||
* @return {boolean}
|
||||
*/
|
||||
PopupsComposeViewModel.prototype.isEmptyForm = function (bIncludeAttachmentInProgress)
|
||||
ComposePopupView.prototype.isEmptyForm = function (bIncludeAttachmentInProgress)
|
||||
{
|
||||
bIncludeAttachmentInProgress = Utils.isUnd(bIncludeAttachmentInProgress) ? true : !!bIncludeAttachmentInProgress;
|
||||
var bAttach = bIncludeAttachmentInProgress ?
|
||||
|
|
@ -1727,7 +1727,7 @@
|
|||
;
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.reset = function ()
|
||||
ComposePopupView.prototype.reset = function ()
|
||||
{
|
||||
this.to('');
|
||||
this.cc('');
|
||||
|
|
@ -1770,7 +1770,7 @@
|
|||
/**
|
||||
* @return {Array}
|
||||
*/
|
||||
PopupsComposeViewModel.prototype.getAttachmentsDownloadsForUpload = function ()
|
||||
ComposePopupView.prototype.getAttachmentsDownloadsForUpload = function ()
|
||||
{
|
||||
return _.map(_.filter(this.attachments(), function (oItem) {
|
||||
return oItem && '' === oItem.tempName();
|
||||
|
|
@ -1779,12 +1779,12 @@
|
|||
});
|
||||
};
|
||||
|
||||
PopupsComposeViewModel.prototype.triggerForResize = function ()
|
||||
ComposePopupView.prototype.triggerForResize = function ()
|
||||
{
|
||||
this.resizer(!this.resizer());
|
||||
this.editorResizeThrottle();
|
||||
};
|
||||
|
||||
module.exports = PopupsComposeViewModel;
|
||||
module.exports = ComposePopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -11,21 +11,21 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Enums = require('Common/Enums'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Data = require('Storage/App/Data'),
|
||||
|
||||
EmailModel = require('Model/Email'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsComposeOpenPgpViewModel()
|
||||
function ComposeOpenPgpPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsComposeOpenPgp');
|
||||
AbstractView.call(this, 'Popups', 'PopupsComposeOpenPgp');
|
||||
|
||||
this.notification = ko.observable('');
|
||||
|
||||
|
|
@ -157,10 +157,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:ComposeOpenPgp', 'PopupsComposeOpenPgpViewModel'], PopupsComposeOpenPgpViewModel);
|
||||
_.extend(PopupsComposeOpenPgpViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/ComposeOpenPgp', 'PopupsComposeOpenPgpViewModel'], ComposeOpenPgpPopupView);
|
||||
_.extend(ComposeOpenPgpPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.clearPopup = function ()
|
||||
ComposeOpenPgpPopupView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.notification('');
|
||||
|
||||
|
|
@ -177,7 +177,7 @@
|
|||
this.resultCallback = null;
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onBuild = function ()
|
||||
ComposeOpenPgpPopupView.prototype.onBuild = function ()
|
||||
{
|
||||
key('tab,shift+tab', Enums.KeyState.PopupComposeOpenPGP, _.bind(function () {
|
||||
|
||||
|
|
@ -196,12 +196,12 @@
|
|||
}, this));
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onHide = function ()
|
||||
ComposeOpenPgpPopupView.prototype.onHide = function ()
|
||||
{
|
||||
this.clearPopup();
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onFocus = function ()
|
||||
ComposeOpenPgpPopupView.prototype.onFocus = function ()
|
||||
{
|
||||
if (this.sign())
|
||||
{
|
||||
|
|
@ -213,7 +213,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsComposeOpenPgpViewModel.prototype.onShow = function (fCallback, sText, sFromEmail, sTo, sCc, sBcc)
|
||||
ComposeOpenPgpPopupView.prototype.onShow = function (fCallback, sText, sFromEmail, sTo, sCc, sBcc)
|
||||
{
|
||||
this.clearPopup();
|
||||
|
||||
|
|
@ -259,6 +259,6 @@
|
|||
this.text(sText);
|
||||
};
|
||||
|
||||
module.exports = PopupsComposeOpenPgpViewModel;
|
||||
module.exports = ComposeOpenPgpPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -17,25 +17,25 @@
|
|||
Selector = require('Common/Selector'),
|
||||
LinkBuilder = require('Common/LinkBuilder'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
EmailModel = require('Model/Email'),
|
||||
ContactModel = require('Model/Contact'),
|
||||
ContactTagModel = require('Model/ContactTag'),
|
||||
ContactPropertyModel = require('Model/ContactProperty'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsContactsViewModel()
|
||||
function ContactsPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsContacts');
|
||||
AbstractView.call(this, 'Popups', 'PopupsContacts');
|
||||
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -277,8 +277,8 @@
|
|||
|
||||
if (Utils.isNonEmptyArray(aE))
|
||||
{
|
||||
kn.hideScreenPopup(require('View:Popup:Contacts'));
|
||||
kn.showScreenPopup(require('View:Popup:Compose'), [Enums.ComposeType.Empty, null, aE]);
|
||||
kn.hideScreenPopup(require('View/Popup/Contacts'));
|
||||
kn.showScreenPopup(require('View/Popup/Compose'), [Enums.ComposeType.Empty, null, aE]);
|
||||
}
|
||||
|
||||
}, function () {
|
||||
|
|
@ -349,7 +349,7 @@
|
|||
this.syncCommand = Utils.createCommand(this, function () {
|
||||
|
||||
var self = this;
|
||||
require('App:RainLoop').contactsSync(function (sResult, oData) {
|
||||
require('App/App').contactsSync(function (sResult, oData) {
|
||||
if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result)
|
||||
{
|
||||
window.alert(Utils.getNotification(
|
||||
|
|
@ -390,19 +390,19 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:Contacts', 'PopupsContactsViewModel'], PopupsContactsViewModel);
|
||||
_.extend(PopupsContactsViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/Contacts', 'PopupsContactsViewModel'], ContactsPopupView);
|
||||
_.extend(ContactsPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsContactsViewModel.prototype.contactTagsSource = function (oData, fResponse)
|
||||
ContactsPopupView.prototype.contactTagsSource = function (oData, fResponse)
|
||||
{
|
||||
require('App:RainLoop').getContactTagsAutocomplete(oData.term, function (aData) {
|
||||
require('App/App').getContactTagsAutocomplete(oData.term, function (aData) {
|
||||
fResponse(_.map(aData, function (oTagItem) {
|
||||
return oTagItem.toLine(false);
|
||||
}));
|
||||
});
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.getPropertyPlceholder = function (sType)
|
||||
ContactsPopupView.prototype.getPropertyPlceholder = function (sType)
|
||||
{
|
||||
var sResult = '';
|
||||
switch (sType)
|
||||
|
|
@ -421,12 +421,12 @@
|
|||
return sResult;
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.addNewProperty = function (sType, sTypeStr)
|
||||
ContactsPopupView.prototype.addNewProperty = function (sType, sTypeStr)
|
||||
{
|
||||
this.viewProperties.push(new ContactPropertyModel(sType, sTypeStr || '', '', true, this.getPropertyPlceholder(sType)));
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.addNewOrFocusProperty = function (sType, sTypeStr)
|
||||
ContactsPopupView.prototype.addNewOrFocusProperty = function (sType, sTypeStr)
|
||||
{
|
||||
var oItem = _.find(this.viewProperties(), function (oItem) {
|
||||
return sType === oItem.type();
|
||||
|
|
@ -442,53 +442,53 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.addNewTag = function ()
|
||||
ContactsPopupView.prototype.addNewTag = function ()
|
||||
{
|
||||
this.viewTags.visibility(true);
|
||||
this.viewTags.focusTrigger(true);
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.addNewEmail = function ()
|
||||
ContactsPopupView.prototype.addNewEmail = function ()
|
||||
{
|
||||
this.addNewProperty(Enums.ContactPropertyType.Email, 'Home');
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.addNewPhone = function ()
|
||||
ContactsPopupView.prototype.addNewPhone = function ()
|
||||
{
|
||||
this.addNewProperty(Enums.ContactPropertyType.Phone, 'Mobile');
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.addNewWeb = function ()
|
||||
ContactsPopupView.prototype.addNewWeb = function ()
|
||||
{
|
||||
this.addNewProperty(Enums.ContactPropertyType.Web);
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.addNewNickname = function ()
|
||||
ContactsPopupView.prototype.addNewNickname = function ()
|
||||
{
|
||||
this.addNewOrFocusProperty(Enums.ContactPropertyType.Nick);
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.addNewNotes = function ()
|
||||
ContactsPopupView.prototype.addNewNotes = function ()
|
||||
{
|
||||
this.addNewOrFocusProperty(Enums.ContactPropertyType.Note);
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.addNewBirthday = function ()
|
||||
ContactsPopupView.prototype.addNewBirthday = function ()
|
||||
{
|
||||
this.addNewOrFocusProperty(Enums.ContactPropertyType.Birthday);
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.exportVcf = function ()
|
||||
ContactsPopupView.prototype.exportVcf = function ()
|
||||
{
|
||||
require('App:RainLoop').download(LinkBuilder.exportContactsVcf());
|
||||
require('App/App').download(LinkBuilder.exportContactsVcf());
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.exportCsv = function ()
|
||||
ContactsPopupView.prototype.exportCsv = function ()
|
||||
{
|
||||
require('App:RainLoop').download(LinkBuilder.exportContactsCsv());
|
||||
require('App/App').download(LinkBuilder.exportContactsCsv());
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.initUploader = function ()
|
||||
ContactsPopupView.prototype.initUploader = function ()
|
||||
{
|
||||
if (this.importUploaderButton())
|
||||
{
|
||||
|
|
@ -528,7 +528,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.removeCheckedOrSelectedContactsFromList = function ()
|
||||
ContactsPopupView.prototype.removeCheckedOrSelectedContactsFromList = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -567,7 +567,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.deleteSelectedContacts = function ()
|
||||
ContactsPopupView.prototype.deleteSelectedContacts = function ()
|
||||
{
|
||||
if (0 < this.contactsCheckedOrSelected().length)
|
||||
{
|
||||
|
|
@ -584,7 +584,7 @@
|
|||
* @param {string} sResult
|
||||
* @param {AjaxJsonDefaultResponse} oData
|
||||
*/
|
||||
PopupsContactsViewModel.prototype.deleteResponse = function (sResult, oData)
|
||||
ContactsPopupView.prototype.deleteResponse = function (sResult, oData)
|
||||
{
|
||||
if (500 < (Enums.StorageResultType.Success === sResult && oData && oData.Time ? Utils.pInt(oData.Time) : 0))
|
||||
{
|
||||
|
|
@ -600,7 +600,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.removeProperty = function (oProp)
|
||||
ContactsPopupView.prototype.removeProperty = function (oProp)
|
||||
{
|
||||
this.viewProperties.remove(oProp);
|
||||
};
|
||||
|
|
@ -608,7 +608,7 @@
|
|||
/**
|
||||
* @param {?ContactModel} oContact
|
||||
*/
|
||||
PopupsContactsViewModel.prototype.populateViewContact = function (oContact)
|
||||
ContactsPopupView.prototype.populateViewContact = function (oContact)
|
||||
{
|
||||
var
|
||||
sId = '',
|
||||
|
|
@ -672,7 +672,7 @@
|
|||
/**
|
||||
* @param {boolean=} bDropPagePosition = false
|
||||
*/
|
||||
PopupsContactsViewModel.prototype.reloadContactList = function (bDropPagePosition)
|
||||
ContactsPopupView.prototype.reloadContactList = function (bDropPagePosition)
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
|
|
@ -732,7 +732,7 @@
|
|||
}, iOffset, Consts.Defaults.ContactsPerPage, this.search());
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.onBuild = function (oDom)
|
||||
ContactsPopupView.prototype.onBuild = function (oDom)
|
||||
{
|
||||
this.oContentVisible = $('.b-list-content', oDom);
|
||||
this.oContentScrollable = $('.content', this.oContentVisible);
|
||||
|
|
@ -760,13 +760,13 @@
|
|||
this.initUploader();
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.onShow = function ()
|
||||
ContactsPopupView.prototype.onShow = function ()
|
||||
{
|
||||
kn.routeOff();
|
||||
this.reloadContactList(true);
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.onHide = function ()
|
||||
ContactsPopupView.prototype.onHide = function ()
|
||||
{
|
||||
kn.routeOn();
|
||||
this.currentContact(null);
|
||||
|
|
@ -776,6 +776,6 @@
|
|||
this.contacts([]);
|
||||
};
|
||||
|
||||
module.exports = PopupsContactsViewModel;
|
||||
module.exports = ContactsPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -11,19 +11,19 @@
|
|||
Consts = require('Common/Consts'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Remote = require('Storage:Admin:Remote'),
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsDomainViewModel()
|
||||
function DomainPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsDomain');
|
||||
AbstractView.call(this, 'Popups', 'PopupsDomain');
|
||||
|
||||
this.edit = ko.observable(false);
|
||||
this.saving = ko.observable(false);
|
||||
|
|
@ -199,10 +199,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:Domain', 'PopupsDomainViewModel'], PopupsDomainViewModel);
|
||||
_.extend(PopupsDomainViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/Domain', 'PopupsDomainViewModel'], DomainPopupView);
|
||||
_.extend(DomainPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsDomainViewModel.prototype.onTestConnectionResponse = function (sResult, oData)
|
||||
DomainPopupView.prototype.onTestConnectionResponse = function (sResult, oData)
|
||||
{
|
||||
this.testing(false);
|
||||
if (Enums.StorageResultType.Success === sResult && oData.Result)
|
||||
|
|
@ -228,14 +228,14 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsDomainViewModel.prototype.onDomainCreateOrSaveResponse = function (sResult, oData)
|
||||
DomainPopupView.prototype.onDomainCreateOrSaveResponse = function (sResult, oData)
|
||||
{
|
||||
this.saving(false);
|
||||
if (Enums.StorageResultType.Success === sResult && oData)
|
||||
{
|
||||
if (oData.Result)
|
||||
{
|
||||
require('App:Admin').reloadDomainList();
|
||||
require('App/Admin').reloadDomainList();
|
||||
this.closeCommand();
|
||||
}
|
||||
else if (Enums.Notification.DomainAlreadyExists === oData.ErrorCode)
|
||||
|
|
@ -249,12 +249,12 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsDomainViewModel.prototype.onHide = function ()
|
||||
DomainPopupView.prototype.onHide = function ()
|
||||
{
|
||||
this.whiteListPage(false);
|
||||
};
|
||||
|
||||
PopupsDomainViewModel.prototype.onShow = function (oDomain)
|
||||
DomainPopupView.prototype.onShow = function (oDomain)
|
||||
{
|
||||
this.saving(false);
|
||||
this.whiteListPage(false);
|
||||
|
|
@ -283,7 +283,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsDomainViewModel.prototype.onFocus = function ()
|
||||
DomainPopupView.prototype.onFocus = function ()
|
||||
{
|
||||
if ('' === this.name())
|
||||
{
|
||||
|
|
@ -291,7 +291,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsDomainViewModel.prototype.clearForm = function ()
|
||||
DomainPopupView.prototype.clearForm = function ()
|
||||
{
|
||||
this.edit(false);
|
||||
this.whiteListPage(false);
|
||||
|
|
@ -313,6 +313,6 @@
|
|||
this.whiteList('');
|
||||
};
|
||||
|
||||
module.exports = PopupsDomainViewModel;
|
||||
module.exports = DomainPopupView;
|
||||
|
||||
}());
|
||||
53
dev/View/Popup/Filter.js
Normal file
53
dev/View/Popup/Filter.js
Normal 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;
|
||||
|
||||
}());
|
||||
|
|
@ -10,21 +10,21 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Cache = require('Storage:RainLoop:Cache'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Cache = require('Storage/App/Cache'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsFolderClearViewModel()
|
||||
function FolderClearPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFolderClear');
|
||||
AbstractView.call(this, 'Popups', 'PopupsFolderClear');
|
||||
|
||||
this.selectedFolder = ko.observable(null);
|
||||
this.clearingProcess = ko.observable(false);
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
self.clearingProcess(false);
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
require('App:RainLoop').reloadMessageList(true);
|
||||
require('App/App').reloadMessageList(true);
|
||||
self.cancelCommand();
|
||||
}
|
||||
else
|
||||
|
|
@ -101,16 +101,16 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:FolderClear', 'PopupsFolderClearViewModel'], PopupsFolderClearViewModel);
|
||||
_.extend(PopupsFolderClearViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/FolderClear', 'PopupsFolderClearViewModel'], FolderClearPopupView);
|
||||
_.extend(FolderClearPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsFolderClearViewModel.prototype.clearPopup = function ()
|
||||
FolderClearPopupView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.clearingProcess(false);
|
||||
this.selectedFolder(null);
|
||||
};
|
||||
|
||||
PopupsFolderClearViewModel.prototype.onShow = function (oFolder)
|
||||
FolderClearPopupView.prototype.onShow = function (oFolder)
|
||||
{
|
||||
this.clearPopup();
|
||||
if (oFolder)
|
||||
|
|
@ -119,6 +119,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
module.exports = PopupsFolderClearViewModel;
|
||||
module.exports = FolderClearPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -11,20 +11,20 @@
|
|||
Consts = require('Common/Consts'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsFolderCreateViewModel()
|
||||
function FolderCreateView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFolderCreate');
|
||||
AbstractView.call(this, 'Popups', 'PopupsFolderCreate');
|
||||
|
||||
Utils.initOnStartOrLangChange(function () {
|
||||
this.sNoParentText = Utils.i18n('POPUPS_CREATE_FOLDER/SELECT_NO_PARENT');
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
Data.foldersCreating(false);
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
require('App:RainLoop').folders();
|
||||
require('App/App').folders();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -100,33 +100,33 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:FolderCreate', 'PopupsFolderCreateViewModel'], PopupsFolderCreateViewModel);
|
||||
_.extend(PopupsFolderCreateViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/FolderCreate', 'PopupsFolderCreateViewModel'], FolderCreateView);
|
||||
_.extend(FolderCreateView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsFolderCreateViewModel.prototype.sNoParentText = '';
|
||||
FolderCreateView.prototype.sNoParentText = '';
|
||||
|
||||
PopupsFolderCreateViewModel.prototype.simpleFolderNameValidation = function (sName)
|
||||
FolderCreateView.prototype.simpleFolderNameValidation = function (sName)
|
||||
{
|
||||
return (/^[^\\\/]+$/g).test(Utils.trim(sName));
|
||||
};
|
||||
|
||||
PopupsFolderCreateViewModel.prototype.clearPopup = function ()
|
||||
FolderCreateView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.folderName('');
|
||||
this.selectedParentValue('');
|
||||
this.folderName.focused(false);
|
||||
};
|
||||
|
||||
PopupsFolderCreateViewModel.prototype.onShow = function ()
|
||||
FolderCreateView.prototype.onShow = function ()
|
||||
{
|
||||
this.clearPopup();
|
||||
};
|
||||
|
||||
PopupsFolderCreateViewModel.prototype.onFocus = function ()
|
||||
FolderCreateView.prototype.onFocus = function ()
|
||||
{
|
||||
this.folderName.focused(true);
|
||||
};
|
||||
|
||||
module.exports = PopupsFolderCreateViewModel;
|
||||
module.exports = FolderCreateView;
|
||||
|
||||
}());
|
||||
|
|
@ -11,21 +11,21 @@
|
|||
Consts = require('Common/Consts'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Settings = require('Storage:Settings'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Settings = require('Storage/Settings'),
|
||||
Data = require('Storage/App/Data'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsFolderSystemViewModel()
|
||||
function FolderSystemPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFolderSystem');
|
||||
AbstractView.call(this, 'Popups', 'PopupsFolderSystem');
|
||||
|
||||
Utils.initOnStartOrLangChange(function () {
|
||||
this.sChooseOnText = Utils.i18n('POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE');
|
||||
|
|
@ -94,16 +94,16 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:FolderSystem', 'PopupsFolderSystemViewModel'], PopupsFolderSystemViewModel);
|
||||
_.extend(PopupsFolderSystemViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/FolderSystem', 'PopupsFolderSystemViewModel'], FolderSystemPopupView);
|
||||
_.extend(FolderSystemPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsFolderSystemViewModel.prototype.sChooseOnText = '';
|
||||
PopupsFolderSystemViewModel.prototype.sUnuseText = '';
|
||||
FolderSystemPopupView.prototype.sChooseOnText = '';
|
||||
FolderSystemPopupView.prototype.sUnuseText = '';
|
||||
|
||||
/**
|
||||
* @param {number=} iNotificationType = Enums.SetSystemFoldersNotification.None
|
||||
*/
|
||||
PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType)
|
||||
FolderSystemPopupView.prototype.onShow = function (iNotificationType)
|
||||
{
|
||||
var sNotification = '';
|
||||
|
||||
|
|
@ -131,6 +131,6 @@
|
|||
this.notification(sNotification);
|
||||
};
|
||||
|
||||
module.exports = PopupsFolderSystemViewModel;
|
||||
module.exports = FolderSystemPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -10,20 +10,20 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
Data = require('Storage/App/Data'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsIdentityViewModel()
|
||||
function IdentityPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsIdentity');
|
||||
AbstractView.call(this, 'Popups', 'PopupsIdentity');
|
||||
|
||||
this.id = '';
|
||||
this.edit = ko.observable(false);
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
{
|
||||
if (oData.Result)
|
||||
{
|
||||
require('App:RainLoop').accountsAndIdentities();
|
||||
require('App/App').accountsAndIdentities();
|
||||
this.cancelCommand();
|
||||
}
|
||||
else if (oData.ErrorCode)
|
||||
|
|
@ -115,10 +115,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:Identity', 'PopupsIdentityViewModel'], PopupsIdentityViewModel);
|
||||
_.extend(PopupsIdentityViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/Identity', 'PopupsIdentityViewModel'], IdentityPopupView);
|
||||
_.extend(IdentityPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsIdentityViewModel.prototype.clearPopup = function ()
|
||||
IdentityPopupView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.id = '';
|
||||
this.edit(false);
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
/**
|
||||
* @param {?IdentityModel} oIdentity
|
||||
*/
|
||||
PopupsIdentityViewModel.prototype.onShow = function (oIdentity)
|
||||
IdentityPopupView.prototype.onShow = function (oIdentity)
|
||||
{
|
||||
this.clearPopup();
|
||||
|
||||
|
|
@ -158,7 +158,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsIdentityViewModel.prototype.onFocus = function ()
|
||||
IdentityPopupView.prototype.onFocus = function ()
|
||||
{
|
||||
if (!this.owner())
|
||||
{
|
||||
|
|
@ -166,6 +166,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
module.exports = PopupsIdentityViewModel;
|
||||
module.exports = IdentityPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -9,27 +9,27 @@
|
|||
|
||||
Enums = require('Common/Enums'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsKeyboardShortcutsHelpViewModel()
|
||||
function KeyboardShortcutsHelpPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsKeyboardShortcutsHelp');
|
||||
AbstractView.call(this, 'Popups', 'PopupsKeyboardShortcutsHelp');
|
||||
|
||||
this.sDefaultKeyScope = Enums.KeyState.PopupKeyboardShortcutsHelp;
|
||||
|
||||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:KeyboardShortcutsHelp', 'PopupsKeyboardShortcutsHelpViewModel'], PopupsKeyboardShortcutsHelpViewModel);
|
||||
_.extend(PopupsKeyboardShortcutsHelpViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/KeyboardShortcutsHelp', 'PopupsKeyboardShortcutsHelpViewModel'], KeyboardShortcutsHelpPopupView);
|
||||
_.extend(KeyboardShortcutsHelpPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom)
|
||||
KeyboardShortcutsHelpPopupView.prototype.onBuild = function (oDom)
|
||||
{
|
||||
key('tab, shift+tab, left, right', Enums.KeyState.PopupKeyboardShortcutsHelp, _.bind(function (event, handler) {
|
||||
if (event && handler)
|
||||
|
|
@ -59,6 +59,6 @@
|
|||
}, this));
|
||||
};
|
||||
|
||||
module.exports = PopupsKeyboardShortcutsHelpViewModel;
|
||||
module.exports = KeyboardShortcutsHelpPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -10,17 +10,17 @@
|
|||
Utils = require('Common/Utils'),
|
||||
Globals = require('Common/Globals'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsLanguagesViewModel()
|
||||
function LanguagesPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsLanguages');
|
||||
AbstractView.call(this, 'Popups', 'PopupsLanguages');
|
||||
|
||||
this.Data = Globals.__APP__.data(); // TODO
|
||||
|
||||
|
|
@ -43,15 +43,15 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:Languages', 'PopupsLanguagesViewModel'], PopupsLanguagesViewModel);
|
||||
_.extend(PopupsLanguagesViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/Languages', 'PopupsLanguagesViewModel'], LanguagesPopupView);
|
||||
_.extend(LanguagesPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsLanguagesViewModel.prototype.languageEnName = function (sLanguage)
|
||||
LanguagesPopupView.prototype.languageEnName = function (sLanguage)
|
||||
{
|
||||
return Utils.convertLangName(sLanguage, true);
|
||||
};
|
||||
|
||||
PopupsLanguagesViewModel.prototype.resetMainLanguage = function ()
|
||||
LanguagesPopupView.prototype.resetMainLanguage = function ()
|
||||
{
|
||||
var sCurrent = this.Data.mainLanguage();
|
||||
_.each(this.languages(), function (oItem) {
|
||||
|
|
@ -59,24 +59,24 @@
|
|||
});
|
||||
};
|
||||
|
||||
PopupsLanguagesViewModel.prototype.onShow = function ()
|
||||
LanguagesPopupView.prototype.onShow = function ()
|
||||
{
|
||||
this.exp(true);
|
||||
|
||||
this.resetMainLanguage();
|
||||
};
|
||||
|
||||
PopupsLanguagesViewModel.prototype.onHide = function ()
|
||||
LanguagesPopupView.prototype.onHide = function ()
|
||||
{
|
||||
this.exp(false);
|
||||
};
|
||||
|
||||
PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
|
||||
LanguagesPopupView.prototype.changeLanguage = function (sLang)
|
||||
{
|
||||
this.Data.mainLanguage(sLang);
|
||||
this.cancelCommand();
|
||||
};
|
||||
|
||||
module.exports = PopupsLanguagesViewModel;
|
||||
module.exports = LanguagesPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -9,19 +9,19 @@
|
|||
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Data = require('Storage:RainLoop:Data'),
|
||||
Data = require('Storage/App/Data'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsNewOpenPgpKeyViewModel()
|
||||
function NewOpenPgpKeyPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsNewOpenPgpKey');
|
||||
AbstractView.call(this, 'Popups', 'PopupsNewOpenPgpKey');
|
||||
|
||||
this.email = ko.observable('');
|
||||
this.email.focus = ko.observable('');
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
oOpenpgpKeyring.publicKeys.importKey(mKeyPair.publicKeyArmored);
|
||||
oOpenpgpKeyring.store();
|
||||
|
||||
require('App:RainLoop').reloadOpenPgpKeys();
|
||||
require('App/App').reloadOpenPgpKeys();
|
||||
Utils.delegateRun(self, 'cancelCommand');
|
||||
}
|
||||
|
||||
|
|
@ -87,10 +87,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:NewOpenPgpKey', 'PopupsNewOpenPgpKeyViewModel'], PopupsNewOpenPgpKeyViewModel);
|
||||
_.extend(PopupsNewOpenPgpKeyViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/NewOpenPgpKey', 'PopupsNewOpenPgpKeyViewModel'], NewOpenPgpKeyPopupView);
|
||||
_.extend(NewOpenPgpKeyPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsNewOpenPgpKeyViewModel.prototype.clearPopup = function ()
|
||||
NewOpenPgpKeyPopupView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.name('');
|
||||
this.password('');
|
||||
|
|
@ -100,16 +100,16 @@
|
|||
this.keyBitLength(2048);
|
||||
};
|
||||
|
||||
PopupsNewOpenPgpKeyViewModel.prototype.onShow = function ()
|
||||
NewOpenPgpKeyPopupView.prototype.onShow = function ()
|
||||
{
|
||||
this.clearPopup();
|
||||
};
|
||||
|
||||
PopupsNewOpenPgpKeyViewModel.prototype.onFocus = function ()
|
||||
NewOpenPgpKeyPopupView.prototype.onFocus = function ()
|
||||
{
|
||||
this.email.focus(true);
|
||||
};
|
||||
|
||||
module.exports = PopupsNewOpenPgpKeyViewModel;
|
||||
module.exports = NewOpenPgpKeyPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -11,19 +11,19 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Remote = require('Storage:Admin:Remote'),
|
||||
Remote = require('Storage/Admin/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsPluginViewModel()
|
||||
function PluginPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsPlugin');
|
||||
AbstractView.call(this, 'Popups', 'PopupsPlugin');
|
||||
|
||||
var self = this;
|
||||
|
||||
|
|
@ -84,10 +84,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:Plugin', 'PopupsPluginViewModel'], PopupsPluginViewModel);
|
||||
_.extend(PopupsPluginViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/Plugin', 'PopupsPluginViewModel'], PluginPopupView);
|
||||
_.extend(PluginPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsPluginViewModel.prototype.onPluginSettingsUpdateResponse = function (sResult, oData)
|
||||
PluginPopupView.prototype.onPluginSettingsUpdateResponse = function (sResult, oData)
|
||||
{
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
|
|
@ -107,7 +107,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsPluginViewModel.prototype.onShow = function (oPlugin)
|
||||
PluginPopupView.prototype.onShow = function (oPlugin)
|
||||
{
|
||||
this.name();
|
||||
this.readme();
|
||||
|
|
@ -135,11 +135,11 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsPluginViewModel.prototype.tryToClosePopup = function ()
|
||||
PluginPopupView.prototype.tryToClosePopup = function ()
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
PopupsAskViewModel = require('View:Popup:Ask')
|
||||
PopupsAskViewModel = require('View/Popup/Ask')
|
||||
;
|
||||
|
||||
if (!kn.isPopupVisible(PopupsAskViewModel))
|
||||
|
|
@ -153,7 +153,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
PopupsPluginViewModel.prototype.onBuild = function ()
|
||||
PluginPopupView.prototype.onBuild = function ()
|
||||
{
|
||||
key('esc', Enums.KeyState.All, _.bind(function () {
|
||||
if (this.modalVisibility())
|
||||
|
|
@ -164,6 +164,6 @@
|
|||
}, this));
|
||||
};
|
||||
|
||||
module.exports = PopupsPluginViewModel;
|
||||
module.exports = PluginPopupView;
|
||||
|
||||
}());
|
||||
|
|
@ -10,19 +10,19 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
Remote = require('Storage:RainLoop:Remote'),
|
||||
Remote = require('Storage/App/Remote'),
|
||||
|
||||
kn = require('App:Knoin'),
|
||||
KnoinAbstractViewModel = require('Knoin:AbstractViewModel')
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
* @extends AbstractView
|
||||
*/
|
||||
function PopupsTwoFactorTestViewModel()
|
||||
function TwoFactorTestPopupView()
|
||||
{
|
||||
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsTwoFactorTest');
|
||||
AbstractView.call(this, 'Popups', 'PopupsTwoFactorTest');
|
||||
|
||||
var self = this;
|
||||
|
||||
|
|
@ -50,10 +50,10 @@
|
|||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
kn.extendAsViewModel(['View:Popup:TwoFactorTest', 'PopupsTwoFactorTestViewModel'], PopupsTwoFactorTestViewModel);
|
||||
_.extend(PopupsTwoFactorTestViewModel.prototype, KnoinAbstractViewModel.prototype);
|
||||
kn.extendAsViewModel(['View/Popup/TwoFactorTest', 'PopupsTwoFactorTestViewModel'], TwoFactorTestPopupView);
|
||||
_.extend(TwoFactorTestPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
PopupsTwoFactorTestViewModel.prototype.clearPopup = function ()
|
||||
TwoFactorTestPopupView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.code('');
|
||||
this.code.focused(false);
|
||||
|
|
@ -61,16 +61,16 @@
|
|||
this.testing(false);
|
||||
};
|
||||
|
||||
PopupsTwoFactorTestViewModel.prototype.onShow = function ()
|
||||
TwoFactorTestPopupView.prototype.onShow = function ()
|
||||
{
|
||||
this.clearPopup();
|
||||
};
|
||||
|
||||
PopupsTwoFactorTestViewModel.prototype.onFocus = function ()
|
||||
TwoFactorTestPopupView.prototype.onFocus = function ()
|
||||
{
|
||||
this.code.focused(true);
|
||||
};
|
||||
|
||||
module.exports = PopupsTwoFactorTestViewModel;
|
||||
module.exports = TwoFactorTestPopupView;
|
||||
|
||||
}());
|
||||
59
dev/View/Popup/ViewOpenPgpKey.js
Normal file
59
dev/View/Popup/ViewOpenPgpKey.js
Normal 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;
|
||||
|
||||
}());
|
||||
|
|
@ -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;
|
||||
|
||||
}());
|
||||
|
|
@ -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;
|
||||
|
||||
}());
|
||||
|
|
@ -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;
|
||||
|
||||
}());
|
||||
|
|
@ -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;
|
||||
|
||||
}());
|
||||
|
|
@ -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;
|
||||
|
||||
}());
|
||||
|
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue