oForm.find('iframe').on('load', function () { var bResult = false, oIframeDoc = null, oResult = {} ; if (fCompleteFunction) { try { oIframeDoc = this.contentDocument ? this.contentDocument: this.contentWindow.document; oResult = $.parseJSON(oIframeDoc.body.innerHTML); bResult = true; } catch (oErr) { oResult = {}; } fCompleteFunction(sUid, bResult, oResult); } fCallback(null, sUid); window.setTimeout(function () { oForm.remove(); }, 100); });
export function previewMessage({title, subject, date, fromCreds, toCreds, toLabel, ccClass, ccCreds, ccLabel}, body, isHtml, print) { const win = window.open(''), doc = win.document, bodyClone = body.clone(), bodyClass = isHtml ? 'html' : 'plain'; clearBqSwitcher(bodyClone); const html = bodyClone ? bodyClone.html() : ''; doc.write(deModule(require('Html/PreviewMessage.html')) .replace('{{title}}', encodeHtml(title)) .replace('{{subject}}', encodeHtml(subject)) .replace('{{date}}', encodeHtml(date)) .replace('{{fromCreds}}', encodeHtml(fromCreds)) .replace('{{toCreds}}', encodeHtml(toCreds)) .replace('{{toLabel}}', encodeHtml(toLabel)) .replace('{{ccClass}}', encodeHtml(ccClass)) .replace('{{ccCreds}}', encodeHtml(ccCreds)) .replace('{{ccLabel}}', encodeHtml(ccLabel)) .replace('{{bodyClass}}', bodyClass) .replace('{{html}}', html) ); doc.close(); if (print) { window.setTimeout(() => win.print(), 100); } }
this.subject(), function (oPopupWin) { if (oPopupWin && oPopupWin.document && oPopupWin.document.body) { $('img.lazy', oPopupWin.document.body).each(function (iIndex, oImg) { var $oImg = $(oImg), sOrig = $oImg.data('original'), sSrc = $oImg.attr('src') ; if (0 <= iIndex && sOrig && !sSrc) { $oImg.attr('src', sOrig); } }); if (bPrint) { window.setTimeout(function () { oPopupWin.print(); }, 100); } } });
DomainsAdminSettings.prototype.startDomainForDeletionTimeout = function () { var self = this; window.clearInterval(this.iDomainForDeletionTimeout); this.iDomainForDeletionTimeout = window.setTimeout(function () { self.domainForDeletion(null); }, 1000 * 3); };
}).always(function() { Utils.__themeTimer = window.setTimeout(function () { themeTrigger(Enums.SaveSettingsStep.Idle); }, 1000); Utils.__themeAjax = null; });
}).always(function() { self.iTimer = window.setTimeout(function () { self.themeTrigger(Enums.SaveSettingsStep.Idle); }, 1000); self.oLastAjax = null; });
MessageListMailBoxUserView.prototype.goToUpUpOrDownDown = function (bUp) { var self = this; window.clearTimeout(this.iGoToUpUpOrDownDownTimeout); this.iGoToUpUpOrDownDownTimeout = window.setTimeout(function () { var oPrev = null, oNext = null, oTemp = null, oCurrent = null, aPages = self.messageListPagenator() ; _.find(aPages, function (oItem) { if (oItem) { if (oCurrent) { oNext = oItem; } if (oItem.current) { oCurrent = oItem; oPrev = oTemp; } if (oNext) { return true; } oTemp = oItem; } return false; }); if (Enums.Layout.NoPreview === SettingsStore.layout() && !self.message()) { self.selector.iFocusedNextHelper = bUp ? -1 : 1; } else { self.selector.iSelectNextHelper = bUp ? -1 : 1; } if (bUp ? oPrev : oNext) { self.selector.unselect(); self.gotoPage(bUp ? oPrev : oNext); } }, 350); };
return (action, fFunction, timeOut) => { if (!timeOuts[action]) { timeOuts[action] = window.setTimeout(() => { fFunction(); timeOuts[action] = 0; }, timeOut); } };
Events.sub('rl.auto-logout-refresh', function () { window.clearTimeout(self.iAutoLogoutTimer); if (0 < self.autoLogout() && !Settings.settingsGet('AccountSignMe')) { self.iAutoLogoutTimer = window.setTimeout(function () { Events.pub('rl.auto-logout'); }, self.autoLogout() * 1000 * 60); } });
UserAjaxUserPromises.prototype.foldersReloadWithTimeout = function (fTrigger) { this.setTrigger(fTrigger, true); var self = this; window.clearTimeout(this._folders_timeout_); this._folders_timeout_ = window.setTimeout(function () { self.foldersReload(fTrigger); }, 500); };
return function (sAction, fFunction, iTimeOut) { if (!oTimeOuts[sAction]) { oTimeOuts[sAction] = window.setTimeout(function () { fFunction(); oTimeOuts[sAction] = 0; }, iTimeOut); } };
oTarget.subscribe(function (bValue) { if (bValue) { window.clearTimeout(oTarget.iFalseTimeoutTimeout); oTarget.iFalseTimeoutTimeout = window.setTimeout(function () { oTarget(false); oTarget.iFalseTimeoutTimeout = 0; }, require('Common/Utils').pInt(iOption)); } });
return function (sAction, fFunction, iTimeOut) { if (Utils.isUnd(oTimeOuts[sAction])) { oTimeOuts[sAction] = 0; } window.clearTimeout(oTimeOuts[sAction]); oTimeOuts[sAction] = window.setTimeout(fFunction, iTimeOut); };
HtmlEditor.prototype.blurTrigger = function () { if (this.fOnBlur) { var self = this; window.clearTimeout(this.iBlurTimer); this.iBlurTimer = window.setTimeout(function () { self.fOnBlur(); }, 200); } };
export const windowResize = _.debounce((timeout) => { if (isUnd(timeout) || isNull(timeout)) { $win.resize(); } else { window.setTimeout(() => { $win.resize(); }, timeout); } }, 50);
FolderListMailBoxUserView.prototype.messagesDropOver = function (oFolder) { window.clearTimeout(this.iDropOverTimer); if (oFolder && oFolder.collapsed()) { this.iDropOverTimer = window.setTimeout(function () { oFolder.collapsed(false); require('App/User').default.setExpandedFolder(oFolder.fullNameHash, true); Utils.windowResize(); }, 500); } };
Utils.windowResize = _.debounce(function (iTimeout) { if (Utils.isUnd(iTimeout)) { Globals.$win.resize(); } else { window.setTimeout(function () { Globals.$win.resize(); }, iTimeout); } }, 50);
window.progressJs.onbeforeend(() => { const _$ = window.$; if (_$) { try { _$('.progressjs-container').hide(); window.setTimeout(() => { _$('.progressjs-container').remove(); }, 200); // eslint-disable-line no-magic-numbers } catch (e) {} // eslint-disable-line no-empty } });
NotificationUserStore.prototype.displayDesktopNotification = function(sImageSrc, sTitle, sText, oMessageData) { if (this.enableDesktopNotification()) { var NotificationClass = this.notificationClass(), oNotification = NotificationClass ? new NotificationClass(sTitle, { 'body': sText, 'icon': sImageSrc }) : null; if (oNotification) { if (oNotification.show) { oNotification.show(); } if (oMessageData) { oNotification.onclick = function() { window.focus(); if (oMessageData.Folder && oMessageData.Uid) { Events.pub('mailbox.message.show', [oMessageData.Folder, oMessageData.Uid]); } }; } window.setTimeout((function(oLocalNotifications) { return function() { if (oLocalNotifications.cancel) { oLocalNotifications.cancel(); } else if (oLocalNotifications.close) { oLocalNotifications.close(); } }; }(oNotification)), Enums.Magics.Time7s); } } };
'write': function (bValue) { if (bValue) { oTarget.valueForRead(bValue); } else { if (oTarget.valueForRead()) { window.clearTimeout(oTarget.iSpecialThrottleTimeout); oTarget.iSpecialThrottleTimeout = window.setTimeout(function () { oTarget.valueForRead(false); oTarget.iSpecialThrottleTimeout = 0; }, oTarget.iSpecialThrottleTimeoutValue); } else { oTarget.valueForRead(bValue); } } }
fNotificationHelper = function (sImageSrc, sTitle, sText) { var NotificationClass = Utils.notificationClass(), oNotification = null ; if (NotificationClass && self.useDesktopNotifications()) { oNotification = new NotificationClass(sTitle, { 'body': sText, 'icon': sImageSrc }); if (oNotification) { if (oNotification.show) { oNotification.show(); } window.setTimeout((function (oLocalNotifications) { return function () { if (oLocalNotifications.cancel) { oLocalNotifications.cancel(); } else if (oLocalNotifications.close) { oLocalNotifications.close(); } }; }(oNotification)), 7000); } } }
fInit = function(){ fValue($oEl.width()); window.setTimeout(function(){ fValue($oEl.width()); }, 500); }
return (action, fFunction, timeOut) => { timeOuts[action] = isUnd(timeOuts[action]) ? 0 : timeOuts[action]; window.clearTimeout(timeOuts[action]); timeOuts[action] = window.setTimeout(fFunction, timeOut); };
/** * @constructor * @extends AbstractApp */ function AppUser() { AbstractApp.call(this, Remote); this.oMoveCache = {}; this.quotaDebounce = _.debounce(this.quota, 1000 * 30); this.moveOrDeleteResponseHelper = _.bind(this.moveOrDeleteResponseHelper, this); this.messagesMoveTrigger = _.debounce(this.messagesMoveTrigger, 500); window.setInterval(function () { Events.pub('interval.30s'); }, 30000); window.setInterval(function () { Events.pub('interval.1m'); }, 60000); window.setInterval(function () { Events.pub('interval.2m'); }, 60000 * 2); window.setInterval(function () { Events.pub('interval.3m'); }, 60000 * 3); window.setInterval(function () { Events.pub('interval.5m'); }, 60000 * 5); window.setInterval(function () { Events.pub('interval.10m'); }, 60000 * 10); window.setInterval(function () { Events.pub('interval.15m'); }, 60000 * 15); window.setInterval(function () { Events.pub('interval.20m'); }, 60000 * 15); window.setTimeout(function () { window.setInterval(function () { Events.pub('interval.2m-after5m'); }, 60000 * 2); }, 60000 * 5); window.setTimeout(function () { window.setInterval(function () { Events.pub('interval.5m-after5m'); }, 60000 * 5); }, 60000 * 5); window.setTimeout(function () { window.setInterval(function () { Events.pub('interval.10m-after5m'); }, 60000 * 10); }, 60000 * 5); $.wakeUp(function () { Remote.jsVersion(function (sResult, oData) { if (Enums.StorageResultType.Success === sResult && oData && !oData.Result) { if (window.parent && !!Settings.settingsGet('InIframe')) { window.parent.location.reload(); } else { window.location.reload(); } } }, Settings.settingsGet('Version')); }, {}, 60 * 60 * 1000); if (Settings.settingsGet('UserBackgroundHash')) { _.delay(function () { $('#rl-bg').attr('style', 'background-image: none !important;') .backstretch(Links.userBackground(Settings.settingsGet('UserBackgroundHash')), { 'fade': Globals.bAnimationSupported ? 1000 : 0, 'centeredX': true, 'centeredY': true }).removeAttr('style'); }, 1000); } this.socialUsers = _.bind(this.socialUsers, this); }
clearTimer = () => { __themeTimer = window.setTimeout(() => themeTrigger(SaveSettingsStep.Idle), 1000); __themeAjax = null; };