ES2015 first look / babeljs

This commit is contained in:
RainLoop Team 2015-11-15 03:23:16 +03:00
parent 5dcceaaca5
commit 445cd155e5
123 changed files with 3214 additions and 3680 deletions

View file

@ -65,7 +65,7 @@
oDeferred = Q.defer()
;
iTimeOut = Utils.isNormal(iTimeOut) ? iTimeOut : Consts.Defaults.DefaultAjaxTimeout;
iTimeOut = Utils.isNormal(iTimeOut) ? iTimeOut : Consts.DEFAULT_AJAX_TIMEOUT;
sAdditionalGetString = Utils.isUnd(sAdditionalGetString) ? '' : Utils.pString(sAdditionalGetString);
if (bPost)
@ -167,7 +167,7 @@
Globals.iTokenErrorCount++;
}
if (Consts.Values.TokenErrorLimit < Globals.iTokenErrorCount)
if (Consts.TOKEN_ERROR_LIMIT < Globals.iTokenErrorCount)
{
if (Globals.__APP__ && Globals.__APP__.loginAndLogoutReload)
{
@ -175,7 +175,7 @@
}
}
if (oErrorData.ClearAuth || oErrorData.Logout || Consts.Values.AjaxErrorLimit < Globals.iAjaxErrorCount)
if (oErrorData.ClearAuth || oErrorData.Logout || Consts.AJAX_ERROR_LIMIT < Globals.iAjaxErrorCount)
{
if (Globals.__APP__ && Globals.__APP__.clearClientSideToken)
{

View file

@ -89,71 +89,6 @@
return this.postRequest('WelcomeClose');
};
// UserAjaxUserPromises.prototype.messageList = function (sFolderFullNameRaw, iOffset, iLimit, sSearch, fTrigger)
// {
// sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw);
// sSearch = Utils.pString(sSearch);
// iOffset = Utils.pInt(iOffset);
// iLimit = Utils.pInt(iLimit);
//
// var sFolderHash = Cache.getFolderHash(sFolderFullNameRaw);
//
// if ('' !== sFolderHash && ('' === sSearch || -1 === sSearch.indexOf('is:')))
// {
// return this.abort('MessageList')
// .getRequest('MessageList', fTrigger,
// Links.subQueryPrefix() + '/' + Base64.urlsafe_encode([
// sFolderFullNameRaw,
// iOffset,
// iLimit,
// sSearch,
// AppStore.projectHash(),
// sFolderHash,
// Cache.getFolderInboxName() === sFolderFullNameRaw ? Cache.getFolderUidNext(sFolderFullNameRaw) : '',
// AppStore.threadsAllowed() && SettingsStore.useThreads() ? '1' : '0',
// ''
// ].join(String.fromCharCode(0))))
// .then(PromisesPopulator.messageList);
// }
// else
// {
// return this.abort('MessageList')
// .postRequest('MessageList', fTrigger,{
// 'Folder': sFolderFullNameRaw,
// 'Offset': iOffset,
// 'Limit': iLimit,
// 'Search': sSearch,
// 'UidNext': Cache.getFolderInboxName() === sFolderFullNameRaw ? Cache.getFolderUidNext(sFolderFullNameRaw) : '',
// 'UseThreads': AppStore.threadsAllowed() && SettingsStore.useThreads() ? '1' : '0'
// })
// .then(PromisesPopulator.messageList);
// }
//
// return this.fastReject(Enums.Notification.UnknownError);
// };
//
// UserAjaxUserPromises.prototype.message = function (sFolderFullNameRaw, iUid, fTrigger)
// {
// sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw);
// iUid = Utils.pInt(iUid);
//
// if (Cache.getFolderFromCacheList(sFolderFullNameRaw) && 0 >= iUid)
// {
// return this.abort('Message')
// .getRequest('Message', fTrigger,
// Links.subQueryPrefix() + '/' + Base64.urlsafe_encode([
// sFolderFullNameRaw, iUid,
// AppStore.projectHash(),
// AppStore.threadsAllowed() && SettingsStore.useThreads() ? '1' : '0'
// ].join(String.fromCharCode(0))))
// .then(function (oData) {
// return oData;
// });
// }
//
// return this.fastReject(Enums.Notification.UnknownError);
// };
module.exports = new UserAjaxUserPromises();
}());

View file

@ -15,7 +15,7 @@
FolderStore = require('Stores/User/Folder'),
Settings = require('Storage/Settings'),
Local = require('Storage/Client'),
Local = require('Storage/Client.jsx'),
FolderModel = require('Model/Folder'),
@ -48,7 +48,7 @@
*/
PromisesUserPopulator.prototype.normalizeFolder = function (sFolderFullNameRaw)
{
return ('' === sFolderFullNameRaw || Consts.Values.UnuseOptionValue === sFolderFullNameRaw ||
return ('' === sFolderFullNameRaw || Consts.UNUSED_OPTION_VALUE === sFolderFullNameRaw ||
null !== Cache.getFolderFromCacheList(sFolderFullNameRaw)) ? sFolderFullNameRaw : '';
};