Small fixes

Release commit
This commit is contained in:
RainLoop Team 2014-10-05 22:37:31 +04:00
parent 78f09856e3
commit c26ab305a1
29 changed files with 385 additions and 371 deletions

View file

@ -10,7 +10,7 @@
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Events = require('Common/Events'), Events = require('Common/Events'),
Settings = require('Storage/Settings'), Settings = require('Storage/Settings'),
@ -132,10 +132,18 @@
AbstractApp.prototype.redirectToAdminPanel = function () AbstractApp.prototype.redirectToAdminPanel = function ()
{ {
_.delay(function () { _.delay(function () {
window.location.href = './?/Admin/'; window.location.href = Links.rootAdmin();
}, 100); }, 100);
}; };
AbstractApp.prototype.clearClientSideToken = function ()
{
if (window.__rlah_clear)
{
window.__rlah_clear();
}
};
/** /**
* @param {boolean=} bLogout = false * @param {boolean=} bLogout = false
* @param {boolean=} bClose = false * @param {boolean=} bClose = false
@ -151,6 +159,11 @@
bLogout = Utils.isUnd(bLogout) ? false : !!bLogout; bLogout = Utils.isUnd(bLogout) ? false : !!bLogout;
bClose = Utils.isUnd(bClose) ? false : !!bClose; bClose = Utils.isUnd(bClose) ? false : !!bClose;
if (bLogout)
{
this.clearClientSideToken();
}
if (bLogout && bClose && window.close) if (bLogout && bClose && window.close)
{ {
window.close(); window.close();
@ -173,7 +186,7 @@
else else
{ {
kn.routeOff(); kn.routeOff();
kn.setHash(LinkBuilder.root(), true); kn.setHash(Links.root(), true);
kn.routeOff(); kn.routeOff();
_.delay(function () { _.delay(function () {

View file

@ -11,7 +11,7 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Settings = require('Storage/Settings'), Settings = require('Storage/Settings'),
Data = require('Storage/Admin/Data'), Data = require('Storage/Admin/Data'),
@ -241,7 +241,7 @@
if (!Settings.settingsGet('AllowAdminPanel')) if (!Settings.settingsGet('AllowAdminPanel'))
{ {
kn.routeOff(); kn.routeOff();
kn.setHash(LinkBuilder.root(), true); kn.setHash(Links.root(), true);
kn.routeOff(); kn.routeOff();
_.defer(function () { _.defer(function () {

View file

@ -15,7 +15,7 @@
Consts = require('Common/Consts'), Consts = require('Common/Consts'),
Plugins = require('Common/Plugins'), Plugins = require('Common/Plugins'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Events = require('Common/Events'), Events = require('Common/Events'),
kn = require('Knoin/Knoin'), kn = require('Knoin/Knoin'),
@ -746,17 +746,17 @@
AppApp.prototype.googleConnect = function () AppApp.prototype.googleConnect = function ()
{ {
window.open(LinkBuilder.socialGoogle(), 'Google', 'left=200,top=100,width=650,height=600,menubar=no,status=no,resizable=yes,scrollbars=yes'); window.open(Links.socialGoogle(), 'Google', 'left=200,top=100,width=650,height=600,menubar=no,status=no,resizable=yes,scrollbars=yes');
}; };
AppApp.prototype.twitterConnect = function () AppApp.prototype.twitterConnect = function ()
{ {
window.open(LinkBuilder.socialTwitter(), 'Twitter', 'left=200,top=100,width=650,height=350,menubar=no,status=no,resizable=yes,scrollbars=yes'); window.open(Links.socialTwitter(), 'Twitter', 'left=200,top=100,width=650,height=350,menubar=no,status=no,resizable=yes,scrollbars=yes');
}; };
AppApp.prototype.facebookConnect = function () AppApp.prototype.facebookConnect = function ()
{ {
window.open(LinkBuilder.socialFacebook(), 'Facebook', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes'); window.open(Links.socialFacebook(), 'Facebook', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
}; };
/** /**
@ -1232,7 +1232,7 @@
else else
{ {
kn.routeOff(); kn.routeOff();
kn.setHash(LinkBuilder.root(), true); kn.setHash(Links.root(), true);
kn.routeOff(); kn.routeOff();
_.defer(function () { _.defer(function () {
@ -1299,7 +1299,7 @@
{ {
if ($LAB && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP)) if ($LAB && window.crypto && window.crypto.getRandomValues && Settings.capa(Enums.Capa.OpenPGP))
{ {
$LAB.script(window.openpgp ? '' : LinkBuilder.openPgpJs()).wait(function () { $LAB.script(window.openpgp ? '' : Links.openPgpJs()).wait(function () {
if (window.openpgp) if (window.openpgp)
{ {
Data.openpgp = window.openpgp; Data.openpgp = window.openpgp;

View file

@ -10,7 +10,7 @@
/** /**
* @constructor * @constructor
*/ */
function LinkBuilder() function Links()
{ {
var Settings = require('Storage/Settings'); var Settings = require('Storage/Settings');
@ -25,16 +25,24 @@
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.root = function () Links.prototype.root = function ()
{ {
return this.sBase; return this.sBase;
}; };
/**
* @return {string}
*/
Links.prototype.rootAdmin = function ()
{
return this.sServer + '/Admin/';
};
/** /**
* @param {string} sDownload * @param {string} sDownload
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.attachmentDownload = function (sDownload) Links.prototype.attachmentDownload = function (sDownload)
{ {
return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/Download/' + sDownload; return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/Download/' + sDownload;
}; };
@ -43,7 +51,7 @@
* @param {string} sDownload * @param {string} sDownload
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.attachmentPreview = function (sDownload) Links.prototype.attachmentPreview = function (sDownload)
{ {
return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/View/' + sDownload; return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/View/' + sDownload;
}; };
@ -52,7 +60,7 @@
* @param {string} sDownload * @param {string} sDownload
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.attachmentPreviewAsPlain = function (sDownload) Links.prototype.attachmentPreviewAsPlain = function (sDownload)
{ {
return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/ViewAsPlain/' + sDownload; return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/ViewAsPlain/' + sDownload;
}; };
@ -60,49 +68,49 @@
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.upload = function () Links.prototype.upload = function ()
{ {
return this.sServer + '/Upload/' + this.sSpecSuffix + '/'; return this.sServer + '/Upload/' + this.sSubQuery + this.sSpecSuffix + '/';
}; };
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.uploadContacts = function () Links.prototype.uploadContacts = function ()
{ {
return this.sServer + '/UploadContacts/' + this.sSpecSuffix + '/'; return this.sServer + '/UploadContacts/' + this.sSubQuery + this.sSpecSuffix + '/';
}; };
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.uploadBackground = function () Links.prototype.uploadBackground = function ()
{ {
return this.sServer + '/UploadBackground/' + this.sSpecSuffix + '/'; return this.sServer + '/UploadBackground/' + this.sSubQuery + this.sSpecSuffix + '/';
}; };
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.append = function () Links.prototype.append = function ()
{ {
return this.sServer + '/Append/' + this.sSpecSuffix + '/'; return this.sServer + '/Append/' + this.sSubQuery + this.sSpecSuffix + '/';
}; };
/** /**
* @param {string} sEmail * @param {string} sEmail
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.change = function (sEmail) Links.prototype.change = function (sEmail)
{ {
return this.sServer + '/Change/' + this.sSpecSuffix + '/' + Utils.encodeURIComponent(sEmail) + '/'; return this.sServer + '/Change/' + this.sSubQuery + this.sSpecSuffix + '/' + Utils.encodeURIComponent(sEmail) + '/';
}; };
/** /**
* @param {string=} sAdd * @param {string=} sAdd
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.ajax = function (sAdd) Links.prototype.ajax = function (sAdd)
{ {
return this.sServer + '/Ajax/' + this.sSubQuery + this.sSpecSuffix + '/' + sAdd; return this.sServer + '/Ajax/' + this.sSubQuery + this.sSpecSuffix + '/' + sAdd;
}; };
@ -111,7 +119,7 @@
* @param {string} sRequestHash * @param {string} sRequestHash
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.messageViewLink = function (sRequestHash) Links.prototype.messageViewLink = function (sRequestHash)
{ {
return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/ViewAsPlain/' + sRequestHash; return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/ViewAsPlain/' + sRequestHash;
}; };
@ -120,7 +128,7 @@
* @param {string} sRequestHash * @param {string} sRequestHash
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.messageDownloadLink = function (sRequestHash) Links.prototype.messageDownloadLink = function (sRequestHash)
{ {
return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/Download/' + sRequestHash; return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/Download/' + sRequestHash;
}; };
@ -129,7 +137,7 @@
* @param {string} sEmail * @param {string} sEmail
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.avatarLink = function (sEmail) Links.prototype.avatarLink = function (sEmail)
{ {
return this.sServer + '/Raw/0/Avatar/' + Utils.encodeURIComponent(sEmail) + '/'; return this.sServer + '/Raw/0/Avatar/' + Utils.encodeURIComponent(sEmail) + '/';
}; };
@ -137,7 +145,7 @@
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.inbox = function () Links.prototype.inbox = function ()
{ {
return this.sBase + 'mailbox/Inbox'; return this.sBase + 'mailbox/Inbox';
}; };
@ -145,7 +153,7 @@
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.messagePreview = function () Links.prototype.messagePreview = function ()
{ {
return this.sBase + 'mailbox/message-preview'; return this.sBase + 'mailbox/message-preview';
}; };
@ -154,7 +162,7 @@
* @param {string=} sScreenName * @param {string=} sScreenName
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.settings = function (sScreenName) Links.prototype.settings = function (sScreenName)
{ {
var sResult = this.sBase + 'settings'; var sResult = this.sBase + 'settings';
if (!Utils.isUnd(sScreenName) && '' !== sScreenName) if (!Utils.isUnd(sScreenName) && '' !== sScreenName)
@ -168,7 +176,7 @@
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.about = function () Links.prototype.about = function ()
{ {
return this.sBase + 'about'; return this.sBase + 'about';
}; };
@ -177,7 +185,7 @@
* @param {string} sScreenName * @param {string} sScreenName
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.admin = function (sScreenName) Links.prototype.admin = function (sScreenName)
{ {
var sResult = this.sBase; var sResult = this.sBase;
switch (sScreenName) { switch (sScreenName) {
@ -201,7 +209,7 @@
* @param {string=} sSearch = '' * @param {string=} sSearch = ''
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.mailBox = function (sFolder, iPage, sSearch) Links.prototype.mailBox = function (sFolder, iPage, sSearch)
{ {
iPage = Utils.isNormal(iPage) ? Utils.pInt(iPage) : 1; iPage = Utils.isNormal(iPage) ? Utils.pInt(iPage) : 1;
sSearch = Utils.pString(sSearch); sSearch = Utils.pString(sSearch);
@ -228,7 +236,7 @@
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.phpInfo = function () Links.prototype.phpInfo = function ()
{ {
return this.sServer + 'Info'; return this.sServer + 'Info';
}; };
@ -237,7 +245,7 @@
* @param {string} sLang * @param {string} sLang
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.langLink = function (sLang) Links.prototype.langLink = function (sLang)
{ {
return this.sServer + '/Lang/0/' + encodeURI(sLang) + '/' + this.sVersion + '/'; return this.sServer + '/Lang/0/' + encodeURI(sLang) + '/' + this.sVersion + '/';
}; };
@ -245,23 +253,23 @@
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.exportContactsVcf = function () Links.prototype.exportContactsVcf = function ()
{ {
return this.sServer + '/Raw/' + this.sSpecSuffix + '/ContactsVcf/'; return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/ContactsVcf/';
}; };
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.exportContactsCsv = function () Links.prototype.exportContactsCsv = function ()
{ {
return this.sServer + '/Raw/' + this.sSpecSuffix + '/ContactsCsv/'; return this.sServer + '/Raw/' + this.sSubQuery + this.sSpecSuffix + '/ContactsCsv/';
}; };
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.emptyContactPic = function () Links.prototype.emptyContactPic = function ()
{ {
return this.sStaticPrefix + 'css/images/empty-contact.png'; return this.sStaticPrefix + 'css/images/empty-contact.png';
}; };
@ -270,7 +278,7 @@
* @param {string} sFileName * @param {string} sFileName
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.sound = function (sFileName) Links.prototype.sound = function (sFileName)
{ {
return this.sStaticPrefix + 'sounds/' + sFileName; return this.sStaticPrefix + 'sounds/' + sFileName;
}; };
@ -279,7 +287,7 @@
* @param {string} sTheme * @param {string} sTheme
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.themePreviewLink = function (sTheme) Links.prototype.themePreviewLink = function (sTheme)
{ {
var sPrefix = 'rainloop/v/' + this.sVersion + '/'; var sPrefix = 'rainloop/v/' + this.sVersion + '/';
if ('@custom' === sTheme.substr(-7)) if ('@custom' === sTheme.substr(-7))
@ -294,7 +302,7 @@
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.notificationMailIcon = function () Links.prototype.notificationMailIcon = function ()
{ {
return this.sStaticPrefix + 'css/images/icom-message-notification.png'; return this.sStaticPrefix + 'css/images/icom-message-notification.png';
}; };
@ -302,7 +310,7 @@
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.openPgpJs = function () Links.prototype.openPgpJs = function ()
{ {
return this.sStaticPrefix + 'js/min/openpgp.js'; return this.sStaticPrefix + 'js/min/openpgp.js';
}; };
@ -310,27 +318,27 @@
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.socialGoogle = function () Links.prototype.socialGoogle = function ()
{ {
return this.sServer + 'SocialGoogle' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : ''); return this.sServer + 'SocialGoogle' + ('' !== this.sSpecSuffix ? '/' + this.sSubQuery + this.sSpecSuffix + '/' : '');
}; };
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.socialTwitter = function () Links.prototype.socialTwitter = function ()
{ {
return this.sServer + 'SocialTwitter' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : ''); return this.sServer + 'SocialTwitter' + ('' !== this.sSpecSuffix ? '/' + this.sSubQuery + this.sSpecSuffix + '/' : '');
}; };
/** /**
* @return {string} * @return {string}
*/ */
LinkBuilder.prototype.socialFacebook = function () Links.prototype.socialFacebook = function ()
{ {
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : ''); return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSubQuery + this.sSpecSuffix + '/' : '');
}; };
module.exports = new LinkBuilder(); module.exports = new Links();
}()); }());

View file

@ -1935,7 +1935,7 @@
{ {
var iStart = Utils.microtime(); var iStart = Utils.microtime();
$.ajax({ $.ajax({
'url': require('Common/LinkBuilder').langLink(sLanguage), 'url': require('Common/Links').langLink(sLanguage),
'dataType': 'script', 'dataType': 'script',
'cache': true 'cache': true
}) })

View file

@ -40,7 +40,7 @@
*/ */
AccountModel.prototype.changeAccountLink = function () AccountModel.prototype.changeAccountLink = function ()
{ {
return require('Common/LinkBuilder').change(this.email); return require('Common/Links').change(this.email);
}; };
module.exports = AccountModel; module.exports = AccountModel;

View file

@ -9,7 +9,7 @@
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
AbstractModel = require('Knoin/AbstractModel') AbstractModel = require('Knoin/AbstractModel')
; ;
@ -125,7 +125,7 @@
*/ */
AttachmentModel.prototype.linkDownload = function () AttachmentModel.prototype.linkDownload = function ()
{ {
return LinkBuilder.attachmentDownload(this.download); return Links.attachmentDownload(this.download);
}; };
/** /**
@ -133,7 +133,7 @@
*/ */
AttachmentModel.prototype.linkPreview = function () AttachmentModel.prototype.linkPreview = function ()
{ {
return LinkBuilder.attachmentPreview(this.download); return Links.attachmentPreview(this.download);
}; };
/** /**
@ -141,7 +141,7 @@
*/ */
AttachmentModel.prototype.linkPreviewAsPlain = function () AttachmentModel.prototype.linkPreviewAsPlain = function ()
{ {
return LinkBuilder.attachmentPreviewAsPlain(this.download); return Links.attachmentPreviewAsPlain(this.download);
}; };
/** /**

View file

@ -9,7 +9,7 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
AbstractModel = require('Knoin/AbstractModel') AbstractModel = require('Knoin/AbstractModel')
; ;
@ -98,7 +98,7 @@
*/ */
ContactModel.prototype.srcAttr = function () ContactModel.prototype.srcAttr = function ()
{ {
return LinkBuilder.emptyContactPic(); return Links.emptyContactPic();
}; };
/** /**

View file

@ -13,7 +13,7 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
EmailModel = require('Model/Email'), EmailModel = require('Model/Email'),
AttachmentModel = require('Model/Attachment'), AttachmentModel = require('Model/Attachment'),
@ -747,7 +747,7 @@
*/ */
MessageModel.prototype.viewLink = function () MessageModel.prototype.viewLink = function ()
{ {
return LinkBuilder.messageViewLink(this.requestHash); return Links.messageViewLink(this.requestHash);
}; };
/** /**
@ -755,7 +755,7 @@
*/ */
MessageModel.prototype.downloadLink = function () MessageModel.prototype.downloadLink = function ()
{ {
return LinkBuilder.messageDownloadLink(this.requestHash); return Links.messageDownloadLink(this.requestHash);
}; };
/** /**

View file

@ -10,7 +10,7 @@
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
kn = require('Knoin/Knoin'), kn = require('Knoin/Knoin'),
AbstractScreen = require('Knoin/AbstractScreen') AbstractScreen = require('Knoin/AbstractScreen')
@ -149,7 +149,7 @@
} }
else else
{ {
kn.setHash(LinkBuilder.settings(), false, true); kn.setHash(Links.settings(), false, true);
} }
}; };

View file

@ -9,7 +9,7 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Settings = require('Storage/Settings'), Settings = require('Storage/Settings'),
Data = require('Storage/Admin/Data') Data = require('Storage/Admin/Data')
@ -137,7 +137,7 @@
*/ */
GeneralAdminSetting.prototype.phpInfoLink = function () GeneralAdminSetting.prototype.phpInfoLink = function ()
{ {
return LinkBuilder.phpInfo(); return Links.phpInfo();
}; };
module.exports = GeneralAdminSetting; module.exports = GeneralAdminSetting;

View file

@ -9,7 +9,7 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Settings = require('Storage/Settings'), Settings = require('Storage/Settings'),
Data = require('Storage/Admin/Data'), Data = require('Storage/Admin/Data'),
@ -128,7 +128,7 @@
*/ */
SecurityAdminSetting.prototype.phpInfoLink = function () SecurityAdminSetting.prototype.phpInfoLink = function ()
{ {
return LinkBuilder.phpInfo(); return Links.phpInfo();
}; };
module.exports = SecurityAdminSetting; module.exports = SecurityAdminSetting;

View file

@ -10,7 +10,7 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Data = require('Storage/App/Data'), Data = require('Storage/App/Data'),
Remote = require('Storage/App/Remote') Remote = require('Storage/App/Remote')
@ -77,7 +77,7 @@
oData.Result && oData.Reload) oData.Result && oData.Reload)
{ {
kn.routeOff(); kn.routeOff();
kn.setHash(LinkBuilder.root(), true); kn.setHash(Links.root(), true);
kn.routeOff(); kn.routeOff();
_.defer(function () { _.defer(function () {

View file

@ -11,7 +11,7 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Data = require('Storage/App/Data'), Data = require('Storage/App/Data'),
Remote = require('Storage/App/Remote') Remote = require('Storage/App/Remote')
@ -122,7 +122,7 @@
'name': sTheme, 'name': sTheme,
'nameDisplay': Utils.convertThemeName(sTheme), 'nameDisplay': Utils.convertThemeName(sTheme),
'selected': ko.observable(sTheme === sCurrentTheme), 'selected': ko.observable(sTheme === sCurrentTheme),
'themePreviewSrc': LinkBuilder.themePreviewLink(sTheme) 'themePreviewSrc': Links.themePreviewLink(sTheme)
}; };
})); }));
}; };

View file

@ -14,7 +14,7 @@
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Plugins = require('Common/Plugins'), Plugins = require('Common/Plugins'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Settings = require('Storage/Settings') Settings = require('Storage/Settings')
; ;
@ -72,17 +72,17 @@
if (oData.ClearAuth || oData.Logout || Consts.Values.AjaxErrorLimit < Globals.iAjaxErrorCount) if (oData.ClearAuth || oData.Logout || Consts.Values.AjaxErrorLimit < Globals.iAjaxErrorCount)
{ {
if (window.__rlah_clear) if (Globals.__APP__)
{ {
window.__rlah_clear(); Globals.__APP__.clearClientSideToken();
}
if (!oData.ClearAuth && Globals.__APP__) if (!oData.ClearAuth)
{ {
Globals.__APP__.loginAndLogoutReload(true); Globals.__APP__.loginAndLogoutReload(true);
} }
} }
} }
}
else if (Enums.StorageResultType.Success === sType && oData && oData.Result) else if (Enums.StorageResultType.Success === sType && oData && oData.Result)
{ {
Globals.iAjaxErrorCount = 0; Globals.iAjaxErrorCount = 0;
@ -175,7 +175,7 @@
oDefAjax = $.ajax({ oDefAjax = $.ajax({
'type': bPost ? 'POST' : 'GET', 'type': bPost ? 'POST' : 'GET',
'url': LinkBuilder.ajax(sGetAdd), 'url': Links.ajax(sGetAdd),
'async': true, 'async': true,
'dataType': 'json', 'dataType': 'json',
'data': bPost ? oParameters : {}, 'data': bPost ? oParameters : {},

View file

@ -9,7 +9,7 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Settings = require('Storage/Settings') Settings = require('Storage/Settings')
; ;
@ -101,7 +101,7 @@
CacheAppStorage.prototype.getUserPic = function (sEmail, fCallback) CacheAppStorage.prototype.getUserPic = function (sEmail, fCallback)
{ {
sEmail = Utils.trim(sEmail); sEmail = Utils.trim(sEmail);
fCallback(this.bCapaGravatar && '' !== sEmail ? LinkBuilder.avatarLink(sEmail) : '', sEmail); fCallback(this.bCapaGravatar && '' !== sEmail ? Links.avatarLink(sEmail) : '', sEmail);
}; };
/** /**

View file

@ -15,7 +15,7 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Settings = require('Storage/Settings'), Settings = require('Storage/Settings'),
Cache = require('Storage/App/Cache'), Cache = require('Storage/App/Cache'),
@ -270,7 +270,7 @@
this.mainMessageListSearch = ko.computed({ this.mainMessageListSearch = ko.computed({
'read': this.messageListSearch, 'read': this.messageListSearch,
'write': function (sValue) { 'write': function (sValue) {
kn.setHash(LinkBuilder.mailBox( kn.setHash(Links.mailBox(
this.currentFolderFullNameHash(), 1, Utils.trim(sValue.toString()) this.currentFolderFullNameHash(), 1, Utils.trim(sValue.toString())
)); ));
}, },
@ -584,7 +584,7 @@
if (3 < iLen) if (3 < iLen)
{ {
fNotificationHelper( fNotificationHelper(
LinkBuilder.notificationMailIcon(), Links.notificationMailIcon(),
this.accountEmail(), this.accountEmail(),
Utils.i18n('MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION', { Utils.i18n('MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION', {
'COUNT': iLen 'COUNT': iLen
@ -596,7 +596,7 @@
for (; iIndex < iLen; iIndex++) for (; iIndex < iLen; iIndex++)
{ {
fNotificationHelper( fNotificationHelper(
LinkBuilder.notificationMailIcon(), Links.notificationMailIcon(),
MessageModel.emailsToLine(MessageModel.initEmailsFromJson(aNewMessages[iIndex].From), false), MessageModel.emailsToLine(MessageModel.initEmailsFromJson(aNewMessages[iIndex].From), false),
aNewMessages[iIndex].Subject aNewMessages[iIndex].Subject
); );

View file

@ -4,14 +4,13 @@
'use strict'; 'use strict';
var var
window = require('window'),
_ = require('_'), _ = require('_'),
ko = require('ko'), ko = require('ko'),
key = require('key'), key = require('key'),
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Settings = require('Storage/Settings'), Settings = require('Storage/Settings'),
Data = require('Storage/App/Data'), Data = require('Storage/App/Data'),
@ -34,7 +33,7 @@
this.accountMenuDropdownTrigger = ko.observable(false); this.accountMenuDropdownTrigger = ko.observable(false);
this.capaAdditionalAccounts = Settings.capa(Enums.Capa.AdditionalAccounts); this.capaAdditionalAccounts = ko.observable(Settings.capa(Enums.Capa.AdditionalAccounts));
this.loading = ko.computed(function () { this.loading = ko.computed(function () {
return this.accountsLoading(); return this.accountsLoading();
@ -66,7 +65,7 @@
AbstractSystemDropDownAppView.prototype.settingsClick = function () AbstractSystemDropDownAppView.prototype.settingsClick = function ()
{ {
require('Knoin/Knoin').setHash(LinkBuilder.settings()); require('Knoin/Knoin').setHash(Links.settings());
}; };
AbstractSystemDropDownAppView.prototype.settingsHelp = function () AbstractSystemDropDownAppView.prototype.settingsHelp = function ()
@ -76,7 +75,7 @@
AbstractSystemDropDownAppView.prototype.addAccountClick = function () AbstractSystemDropDownAppView.prototype.addAccountClick = function ()
{ {
if (this.capaAdditionalAccounts) if (this.capaAdditionalAccounts())
{ {
require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount')); require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount'));
} }
@ -85,11 +84,6 @@
AbstractSystemDropDownAppView.prototype.logoutClick = function () AbstractSystemDropDownAppView.prototype.logoutClick = function ()
{ {
Remote.logout(function () { Remote.logout(function () {
if (window.__rlah_clear)
{
window.__rlah_clear();
}
require('App/App').loginAndLogoutReload(true, require('App/App').loginAndLogoutReload(true,
Settings.settingsGet('ParentEmail') && 0 < Settings.settingsGet('ParentEmail').length); Settings.settingsGet('ParentEmail') && 0 < Settings.settingsGet('ParentEmail').length);
}); });

View file

@ -11,7 +11,7 @@
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Settings = require('Storage/Settings'), Settings = require('Storage/Settings'),
Data = require('Storage/App/Data'), Data = require('Storage/App/Data'),
@ -187,7 +187,7 @@
this.facebookCommand = Utils.createCommand(this, function () { this.facebookCommand = Utils.createCommand(this, function () {
window.open(LinkBuilder.socialFacebook(), 'Facebook', window.open(Links.socialFacebook(), 'Facebook',
'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes'); 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
return true; return true;
@ -199,7 +199,7 @@
this.googleCommand = Utils.createCommand(this, function () { this.googleCommand = Utils.createCommand(this, function () {
window.open(LinkBuilder.socialGoogle(), 'Google', window.open(Links.socialGoogle(), 'Google',
'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes'); 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
return true; return true;
@ -211,7 +211,7 @@
this.twitterCommand = Utils.createCommand(this, function () { this.twitterCommand = Utils.createCommand(this, function () {
window.open(LinkBuilder.socialTwitter(), 'Twitter', window.open(Links.socialTwitter(), 'Twitter',
'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes'); 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
return true; return true;

View file

@ -13,7 +13,7 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Settings = require('Storage/Settings'), Settings = require('Storage/Settings'),
Cache = require('Storage/App/Cache'), Cache = require('Storage/App/Cache'),
@ -96,7 +96,7 @@
Cache.setFolderHash(oFolder.fullNameRaw, ''); Cache.setFolderHash(oFolder.fullNameRaw, '');
} }
kn.setHash(LinkBuilder.mailBox(oFolder.fullNameHash)); kn.setHash(Links.mailBox(oFolder.fullNameHash));
} }
}) })
; ;
@ -258,7 +258,7 @@
FolderListMailBoxAppView.prototype.configureFolders = function () FolderListMailBoxAppView.prototype.configureFolders = function ()
{ {
kn.setHash(LinkBuilder.settings('folders')); kn.setHash(Links.settings('folders'));
}; };
FolderListMailBoxAppView.prototype.contactsClick = function () FolderListMailBoxAppView.prototype.contactsClick = function ()

View file

@ -15,7 +15,7 @@
Consts = require('Common/Consts'), Consts = require('Common/Consts'),
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Events = require('Common/Events'), Events = require('Common/Events'),
Selector = require('Common/Selector'), Selector = require('Common/Selector'),
@ -229,7 +229,7 @@
if (Enums.Layout.NoPreview === Data.layout()) if (Enums.Layout.NoPreview === Data.layout())
{ {
kn.setHash(LinkBuilder.messagePreview(), true); kn.setHash(Links.messagePreview(), true);
Data.message.focused(true); Data.message.focused(true);
} }
} }
@ -672,7 +672,7 @@
var oPage = ko.dataFor(this); var oPage = ko.dataFor(this);
if (oPage) if (oPage)
{ {
kn.setHash(LinkBuilder.mailBox( kn.setHash(Links.mailBox(
Data.currentFolderFullNameHash(), Data.currentFolderFullNameHash(),
oPage.value, oPage.value,
Data.messageListSearch() Data.messageListSearch()
@ -885,7 +885,7 @@
var var
oJua = new Jua({ oJua = new Jua({
'action': LinkBuilder.append(), 'action': Links.append(),
'name': 'AppendFile', 'name': 'AppendFile',
'queueSize': 1, 'queueSize': 1,
'multipleSizeLimit': 1, 'multipleSizeLimit': 1,

View file

@ -7,7 +7,7 @@
_ = require('_'), _ = require('_'),
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
kn = require('Knoin/Knoin'), kn = require('Knoin/Knoin'),
AbstractView = require('Knoin/AbstractView') AbstractView = require('Knoin/AbstractView')
@ -35,12 +35,12 @@
MenuSettingsAppView.prototype.link = function (sRoute) MenuSettingsAppView.prototype.link = function (sRoute)
{ {
return LinkBuilder.settings(sRoute); return Links.settings(sRoute);
}; };
MenuSettingsAppView.prototype.backToMailBoxClick = function () MenuSettingsAppView.prototype.backToMailBoxClick = function ()
{ {
kn.setHash(LinkBuilder.inbox()); kn.setHash(Links.inbox());
}; };
module.exports = MenuSettingsAppView; module.exports = MenuSettingsAppView;

View file

@ -8,7 +8,7 @@
key = require('key'), key = require('key'),
Enums = require('Common/Enums'), Enums = require('Common/Enums'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Data = require('Storage/App/Data'), Data = require('Storage/App/Data'),
@ -45,7 +45,7 @@
PaneSettingsAppView.prototype.backToMailBoxClick = function () PaneSettingsAppView.prototype.backToMailBoxClick = function ()
{ {
kn.setHash(LinkBuilder.inbox()); kn.setHash(Links.inbox());
}; };
module.exports = PaneSettingsAppView; module.exports = PaneSettingsAppView;

View file

@ -17,7 +17,7 @@
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
Events = require('Common/Events'), Events = require('Common/Events'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
HtmlEditor = require('Common/HtmlEditor'), HtmlEditor = require('Common/HtmlEditor'),
Settings = require('Storage/Settings'), Settings = require('Storage/Settings'),
@ -1288,7 +1288,7 @@
oUploadCache = {}, oUploadCache = {},
iAttachmentSizeLimit = Utils.pInt(Settings.settingsGet('AttachmentLimit')), iAttachmentSizeLimit = Utils.pInt(Settings.settingsGet('AttachmentLimit')),
oJua = new Jua({ oJua = new Jua({
'action': LinkBuilder.upload(), 'action': Links.upload(),
'name': 'uploader', 'name': 'uploader',
'queueSize': 2, 'queueSize': 2,
'multipleSizeLimit': 50, 'multipleSizeLimit': 50,

View file

@ -15,7 +15,7 @@
Globals = require('Common/Globals'), Globals = require('Common/Globals'),
Utils = require('Common/Utils'), Utils = require('Common/Utils'),
Selector = require('Common/Selector'), Selector = require('Common/Selector'),
LinkBuilder = require('Common/LinkBuilder'), Links = require('Common/Links'),
Data = require('Storage/App/Data'), Data = require('Storage/App/Data'),
Remote = require('Storage/App/Remote'), Remote = require('Storage/App/Remote'),
@ -447,12 +447,12 @@
ContactsPopupView.prototype.exportVcf = function () ContactsPopupView.prototype.exportVcf = function ()
{ {
require('App/App').download(LinkBuilder.exportContactsVcf()); require('App/App').download(Links.exportContactsVcf());
}; };
ContactsPopupView.prototype.exportCsv = function () ContactsPopupView.prototype.exportCsv = function ()
{ {
require('App/App').download(LinkBuilder.exportContactsCsv()); require('App/App').download(Links.exportContactsCsv());
}; };
ContactsPopupView.prototype.initUploader = function () ContactsPopupView.prototype.initUploader = function ()
@ -461,7 +461,7 @@
{ {
var var
oJua = new Jua({ oJua = new Jua({
'action': LinkBuilder.uploadContacts(), 'action': Links.uploadContacts(),
'name': 'uploader', 'name': 'uploader',
'queueSize': 1, 'queueSize': 1,
'multipleSizeLimit': 1, 'multipleSizeLimit': 1,

View file

@ -31,7 +31,7 @@
KeyboardShortcutsHelpPopupView.prototype.onBuild = function (oDom) KeyboardShortcutsHelpPopupView.prototype.onBuild = function (oDom)
{ {
key('tab, shift+tab, left, right', Enums.KeyState.PopupKeyboardShortcutsHelp, _.bind(function (event, handler) { key('tab, shift+tab, left, right', Enums.KeyState.PopupKeyboardShortcutsHelp, _.throttle(_.bind(function (event, handler) {
if (event && handler) if (event && handler)
{ {
var var
@ -56,7 +56,7 @@
$tabs.eq(iIndex).find('a[data-toggle="tab"]').tab('show'); $tabs.eq(iIndex).find('a[data-toggle="tab"]').tab('show');
return false; return false;
} }
}, this)); }, this), 100));
}; };
module.exports = KeyboardShortcutsHelpPopupView; module.exports = KeyboardShortcutsHelpPopupView;

View file

@ -1,8 +1,8 @@
{ {
"name": "RainLoop", "name": "RainLoop",
"title": "RainLoop Webmail", "title": "RainLoop Webmail",
"version": "1.6.9", "version": "1.6.10",
"release": "170", "release": "180",
"description": "Simple, modern & fast web-based email client", "description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net", "homepage": "http://rainloop.net",
"main": "gulpfile.js", "main": "gulpfile.js",

View file

@ -711,7 +711,6 @@ class Http
@\header('ETag: '.$sEtag, true); @\header('ETag: '.$sEtag, true);
@\header('Last-Modified: '.\gmdate('D, d M Y H:i:s', $iLastModified).' UTC', true); @\header('Last-Modified: '.\gmdate('D, d M Y H:i:s', $iLastModified).' UTC', true);
@\header('Expires: '.\gmdate('D, j M Y H:i:s', $iExpires).' UTC', true); @\header('Expires: '.\gmdate('D, j M Y H:i:s', $iExpires).' UTC', true);
@\header('Connection: close');
@\header('X-RainLoop-Cache: yes'); @\header('X-RainLoop-Cache: yes');
} }
} }

View file

@ -6631,7 +6631,7 @@ class Actions
{ {
$oAccount = $this->getAccountFromToken(); $oAccount = $this->getAccountFromToken();
\header('Content-Type: text/directory; charset=UTF-8'); \header('Content-Type: text/x-vcard; charset=UTF-8');
\header('Content-Disposition: attachment; filename="contacts.vcf"', true); \header('Content-Disposition: attachment; filename="contacts.vcf"', true);
\header('Accept-Ranges: none', true); \header('Accept-Ranges: none', true);
\header('Content-Transfer-Encoding: binary'); \header('Content-Transfer-Encoding: binary');
@ -6649,7 +6649,7 @@ class Actions
{ {
$oAccount = $this->getAccountFromToken(); $oAccount = $this->getAccountFromToken();
\header('Content-Type: ext/csv; charset=UTF-8'); \header('Content-Type: text/csv; charset=UTF-8');
\header('Content-Disposition: attachment; filename="contacts.csv"', true); \header('Content-Disposition: attachment; filename="contacts.csv"', true);
\header('Accept-Ranges: none', true); \header('Accept-Ranges: none', true);
\header('Content-Transfer-Encoding: binary'); \header('Content-Transfer-Encoding: binary');