Fix back button in no-preview layout

layout setting
This commit is contained in:
RainLoop Team 2014-02-03 19:54:05 +04:00
parent 7bba9c17ea
commit 6928fcc48e
17 changed files with 385 additions and 238 deletions

View file

@ -204,6 +204,11 @@ AbstractApp.prototype.loginAndLogoutReload = function (bLogout, bClose)
} }
}; };
AbstractApp.prototype.historyBack = function ()
{
window.history.back();
};
/** /**
* @param {string} sQuery * @param {string} sQuery
* @param {Function} fCallback * @param {Function} fCallback

View file

@ -236,8 +236,16 @@ Enums.InterfaceAnimation = {
/** /**
* @enum {number} * @enum {number}
*/ */
Enums.ContactScopeType = { Enums.Layout = {
'NoPreview': 0,
'SidePreview': 1,
'BottomPreview': 2
};
/**
* @enum {number}
*/
Enums.ContactScopeType = {
'Default': 0, 'Default': 0,
'ShareAll': 2 'ShareAll': 2
}; };

View file

@ -126,6 +126,14 @@ LinkBuilder.prototype.inbox = function ()
return this.sBase + 'mailbox/Inbox'; return this.sBase + 'mailbox/Inbox';
}; };
/**
* @return {string}
*/
LinkBuilder.prototype.messagePreview = function ()
{
return this.sBase + 'mailbox/message-preview';
};
/** /**
* @param {string=} sScreenName * @param {string=} sScreenName
* @return {string} * @return {string}

View file

@ -751,6 +751,7 @@ Utils.initDataConstructorBySettings = function (oData)
oData.useThreads = ko.observable(true); oData.useThreads = ko.observable(true);
oData.replySameFolder = ko.observable(true); oData.replySameFolder = ko.observable(true);
oData.usePreviewPane = ko.observable(true); oData.usePreviewPane = ko.observable(true);
oData.layout = ko.observable(Enums.Layout.SidePreview);
oData.useCheckboxesInList = ko.observable(true); oData.useCheckboxesInList = ko.observable(true);
oData.interfaceAnimation.subscribe(function (sValue) { oData.interfaceAnimation.subscribe(function (sValue) {

View file

@ -43,17 +43,27 @@ MailBoxScreen.prototype.onShow = function ()
* @param {string} sFolderHash * @param {string} sFolderHash
* @param {number} iPage * @param {number} iPage
* @param {string} sSearch * @param {string} sSearch
* @param {boolean=} bPreview = false
*/ */
MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch) MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPreview)
{ {
var if (Utils.isUnd(bPreview) ? false : !!bPreview)
oData = RL.data(),
sFolderFullNameRaw = RL.cache().getFolderFullNameRaw(sFolderHash),
oFolder = RL.cache().getFolderFromCacheList(sFolderFullNameRaw)
;
if (oFolder)
{ {
if (!RL.data().usePreviewPane() && !RL.data().message())
{
RL.historyBack();
}
}
else
{
var
oData = RL.data(),
sFolderFullNameRaw = RL.cache().getFolderFullNameRaw(sFolderHash),
oFolder = RL.cache().getFolderFromCacheList(sFolderFullNameRaw)
;
if (oFolder)
{
oData oData
.currentFolder(oFolder) .currentFolder(oFolder)
.messageListPage(iPage) .messageListPage(iPage)
@ -63,10 +73,12 @@ MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch)
if (!oData.usePreviewPane() && oData.message()) if (!oData.usePreviewPane() && oData.message())
{ {
oData.message(null); oData.message(null);
oData.messageFullScreenMode(false);
} }
RL.reloadMessageList(); RL.reloadMessageList();
} }
}
}; };
MailBoxScreen.prototype.onStart = function () MailBoxScreen.prototype.onStart = function ()
@ -130,6 +142,9 @@ MailBoxScreen.prototype.onStart = function ()
MailBoxScreen.prototype.routes = function () MailBoxScreen.prototype.routes = function ()
{ {
var var
fNormP = function () {
return ['Inbox', 1, '', true];
},
fNormS = function (oRequest, oVals) { fNormS = function (oRequest, oVals) {
oVals[0] = Utils.pString(oVals[0]); oVals[0] = Utils.pString(oVals[0]);
oVals[1] = Utils.pInt(oVals[1]); oVals[1] = Utils.pInt(oVals[1]);
@ -142,7 +157,7 @@ MailBoxScreen.prototype.routes = function ()
oVals[1] = 1; oVals[1] = 1;
} }
return [decodeURI(oVals[0]), oVals[1], decodeURI(oVals[2])]; return [decodeURI(oVals[0]), oVals[1], decodeURI(oVals[2]), false];
}, },
fNormD = function (oRequest, oVals) { fNormD = function (oRequest, oVals) {
oVals[0] = Utils.pString(oVals[0]); oVals[0] = Utils.pString(oVals[0]);
@ -153,7 +168,7 @@ MailBoxScreen.prototype.routes = function ()
oVals[0] = 'Inbox'; oVals[0] = 'Inbox';
} }
return [decodeURI(oVals[0]), 1, decodeURI(oVals[1])]; return [decodeURI(oVals[0]), 1, decodeURI(oVals[1]), false];
} }
; ;
@ -161,6 +176,7 @@ MailBoxScreen.prototype.routes = function ()
[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/, {'normalize_': fNormS}], [/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/, {'normalize_': fNormS}],
[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/, {'normalize_': fNormS}], [/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/, {'normalize_': fNormS}],
[/^([a-zA-Z0-9]+)\/(.+)\/?$/, {'normalize_': fNormD}], [/^([a-zA-Z0-9]+)\/(.+)\/?$/, {'normalize_': fNormD}],
[/^message-preview$/, {'normalize_': fNormP}],
[/^([^\/]*)$/, {'normalize_': fNormS}] [/^([^\/]*)$/, {'normalize_': fNormS}]
]; ];
}; };

View file

@ -18,6 +18,7 @@ function SettingsGeneral()
this.useThreads = oData.useThreads; this.useThreads = oData.useThreads;
this.replySameFolder = oData.replySameFolder; this.replySameFolder = oData.replySameFolder;
this.usePreviewPane = oData.usePreviewPane; this.usePreviewPane = oData.usePreviewPane;
this.layout = oData.layout;
this.useCheckboxesInList = oData.useCheckboxesInList; this.useCheckboxesInList = oData.useCheckboxesInList;
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings; this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
@ -135,6 +136,15 @@ SettingsGeneral.prototype.onBuild = function ()
}); });
}); });
oData.layout.subscribe(function (nValue) {
oData.messageList([]);
RL.remote().saveSettings(Utils.emptyFunction, {
'Layout': nValue
});
});
oData.useCheckboxesInList.subscribe(function (bValue) { oData.useCheckboxesInList.subscribe(function (bValue) {
RL.remote().saveSettings(Utils.emptyFunction, { RL.remote().saveSettings(Utils.emptyFunction, {
'UseCheckboxesInList': bValue ? '1' : '0' 'UseCheckboxesInList': bValue ? '1' : '0'

View file

@ -49,6 +49,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.useThreads(!!RL.settingsGet('UseThreads')); this.useThreads(!!RL.settingsGet('UseThreads'));
this.replySameFolder(!!RL.settingsGet('ReplySameFolder')); this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
this.usePreviewPane(!!RL.settingsGet('UsePreviewPane')); this.usePreviewPane(!!RL.settingsGet('UsePreviewPane'));
this.layout(!!RL.settingsGet('UsePreviewPane') ? Enums.Layout.SidePreview : Enums.Layout.NoPreview); // TODO
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList')); this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial')); this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial'));

View file

@ -48,7 +48,7 @@ function MailBoxMessageListViewModel()
this.dragOverBodyArea = ko.observable(null); this.dragOverBodyArea = ko.observable(null);
this.messageListItemTemplate = ko.computed(function () { this.messageListItemTemplate = ko.computed(function () {
return oData.usePreviewPane() ? return Enums.Layout.NoPreview !== oData.layout() ?
'MailMessageListItem' : 'MailMessageListItemNoPreviewPane'; 'MailMessageListItem' : 'MailMessageListItemNoPreviewPane';
}); });
@ -163,6 +163,11 @@ function MailBoxMessageListViewModel()
this.selector.on('onItemSelect', _.bind(function (oMessage) { this.selector.on('onItemSelect', _.bind(function (oMessage) {
if (oMessage) if (oMessage)
{ {
if (Enums.Layout.NoPreview === oData.layout())
{
kn.setHash(RL.link().messagePreview(), true);
}
oData.message(oData.staticMessageList.populateByMessageListItem(oMessage)); oData.message(oData.staticMessageList.populateByMessageListItem(oMessage));
this.populateMessageBody(oData.message()); this.populateMessageBody(oData.message());
} }
@ -723,7 +728,7 @@ MailBoxMessageListViewModel.prototype.onBuild = function (oDom)
if (oEvent && self.viewModelVisibility() && oData.useKeyboardShortcuts() && !RL.popupVisibility() && !oData.messageFullScreenMode() && !Utils.inFocus()) if (oEvent && self.viewModelVisibility() && oData.useKeyboardShortcuts() && !RL.popupVisibility() && !oData.messageFullScreenMode() && !Utils.inFocus())
{ {
if (oData.usePreviewPane() || (!oData.message() && (Enums.EventKeyCode.Delete === iKeyCode || Enums.EventKeyCode.A === iKeyCode))) if (Enums.Layout.NoPreview !== oData.layout() || (!oData.message() && (Enums.EventKeyCode.Delete === iKeyCode || Enums.EventKeyCode.A === iKeyCode)))
{ {
if (oEvent.ctrlKey && Enums.EventKeyCode.A === iKeyCode) if (oEvent.ctrlKey && Enums.EventKeyCode.A === iKeyCode)
{ {

View file

@ -27,7 +27,7 @@ function MailBoxMessageViewViewModel()
this.messagesBodiesDom = oData.messagesBodiesDom; this.messagesBodiesDom = oData.messagesBodiesDom;
this.useThreads = oData.useThreads; this.useThreads = oData.useThreads;
this.replySameFolder = oData.replySameFolder; this.replySameFolder = oData.replySameFolder;
this.usePreviewPane = oData.usePreviewPane; this.layout = oData.layout;
this.isMessageSelected = oData.isMessageSelected; this.isMessageSelected = oData.isMessageSelected;
this.messageActiveDom = oData.messageActiveDom; this.messageActiveDom = oData.messageActiveDom;
this.messageError = oData.messageError; this.messageError = oData.messageError;
@ -44,7 +44,14 @@ function MailBoxMessageViewViewModel()
// commands // commands
this.closeMessage = Utils.createCommand(this, function () { this.closeMessage = Utils.createCommand(this, function () {
oData.message(null); if (Enums.Layout.NoPreview === oData.layout())
{
RL.historyBack();
}
else
{
oData.message(null);
}
}); });
this.replyCommand = createCommandHelper(Enums.ComposeType.Reply); this.replyCommand = createCommandHelper(Enums.ComposeType.Reply);
@ -247,13 +254,13 @@ MailBoxMessageViewViewModel.prototype.onBuild = function (oDom)
iKeyCode = oEvent ? oEvent.keyCode : 0 iKeyCode = oEvent ? oEvent.keyCode : 0
; ;
if (0 < iKeyCode && (Enums.EventKeyCode.Backspace === iKeyCode || Enums.EventKeyCode.Esc === iKeyCode) && if (0 < iKeyCode && (Enums.EventKeyCode.Esc === iKeyCode) &&
self.viewModelVisibility() && oData.useKeyboardShortcuts() && !Utils.inFocus() && oData.message()) self.viewModelVisibility() && oData.useKeyboardShortcuts() && !Utils.inFocus() && oData.message())
{ {
self.fullScreenMode(false); self.fullScreenMode(false);
if (!oData.usePreviewPane()) if (Enums.Layout.NoPreview === oData.layout())
{ {
oData.message(null); RL.historyBack();
} }
bResult = false; bResult = false;

View file

@ -1141,9 +1141,11 @@ class Utils
public static function IsRTL($sUtfString) public static function IsRTL($sUtfString)
{ {
// \x{0591}-\x{05F4} - Hebrew // \x{0591}-\x{05F4} - Hebrew
// \x{FB1D}-\x{FB40} - Hebrew ? // \x{0600}-\x{068F} - Arabic
// \x{0621}-\x{064A} - Arabic // \x{0750}-\x{077F} - Arabic
return 0 < (int) preg_match('/[\x{0591}-\x{05F4}\x{FB1D}-\x{FB40}\x{0621}-\x{064A}]/u', $sUtfString); // \x{08A0}-\x{08FF} - Arabic
// \x{103A0}-\x{103DF} - Old Persian
return 0 < (int) preg_match('/[\x{0591}-\x{05F4}\x{0600}-\x{068F}\x{0750}-\x{077F}\x{08A0}-\x{08FF}\x{103A0}-\x{103DF}]/u', $sUtfString);
} }
/** /**

View file

@ -12,7 +12,7 @@
</label> </label>
</div> </div>
</div> </div>
<div class="control-group"> <!-- <div class="control-group">
<div class="controls"> <div class="controls">
<label data-bind="click: function () { openPGP(!openPGP()); }"> <label data-bind="click: function () { openPGP(!openPGP()); }">
<i data-bind="css: openPGP() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i> <i data-bind="css: openPGP() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
@ -20,7 +20,7 @@
Allow OpenPGP (unstable) Allow OpenPGP (unstable)
</label> </label>
</div> </div>
</div> </div>-->
<div class="control-group"> <div class="control-group">
<div class="controls"> <div class="controls">
<a href="#" target="_blank" class="g-ui-link" data-bind="link: phpInfoLink()">Show PHP information</a> <a href="#" target="_blank" class="g-ui-link" data-bind="link: phpInfoLink()">Show PHP information</a>

View file

@ -519,8 +519,16 @@ Enums.InterfaceAnimation = {
/** /**
* @enum {number} * @enum {number}
*/ */
Enums.ContactScopeType = { Enums.Layout = {
'NoPreview': 0,
'SidePreview': 1,
'BottomPreview': 2
};
/**
* @enum {number}
*/
Enums.ContactScopeType = {
'Default': 0, 'Default': 0,
'ShareAll': 2 'ShareAll': 2
}; };
@ -1370,6 +1378,7 @@ Utils.initDataConstructorBySettings = function (oData)
oData.useThreads = ko.observable(true); oData.useThreads = ko.observable(true);
oData.replySameFolder = ko.observable(true); oData.replySameFolder = ko.observable(true);
oData.usePreviewPane = ko.observable(true); oData.usePreviewPane = ko.observable(true);
oData.layout = ko.observable(Enums.Layout.SidePreview);
oData.useCheckboxesInList = ko.observable(true); oData.useCheckboxesInList = ko.observable(true);
oData.interfaceAnimation.subscribe(function (sValue) { oData.interfaceAnimation.subscribe(function (sValue) {
@ -3096,6 +3105,14 @@ LinkBuilder.prototype.inbox = function ()
return this.sBase + 'mailbox/Inbox'; return this.sBase + 'mailbox/Inbox';
}; };
/**
* @return {string}
*/
LinkBuilder.prototype.messagePreview = function ()
{
return this.sBase + 'mailbox/message-preview';
};
/** /**
* @param {string=} sScreenName * @param {string=} sScreenName
* @return {string} * @return {string}
@ -6278,6 +6295,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.useThreads(!!RL.settingsGet('UseThreads')); this.useThreads(!!RL.settingsGet('UseThreads'));
this.replySameFolder(!!RL.settingsGet('ReplySameFolder')); this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
this.usePreviewPane(!!RL.settingsGet('UsePreviewPane')); this.usePreviewPane(!!RL.settingsGet('UsePreviewPane'));
this.layout(!!RL.settingsGet('UsePreviewPane') ? Enums.Layout.SidePreview : Enums.Layout.NoPreview); // TODO
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList')); this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial')); this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial'));
@ -7343,6 +7361,11 @@ AbstractApp.prototype.loginAndLogoutReload = function (bLogout, bClose)
} }
}; };
AbstractApp.prototype.historyBack = function ()
{
window.history.back();
};
/** /**
* @param {string} sQuery * @param {string} sQuery
* @param {Function} fCallback * @param {Function} fCallback

File diff suppressed because one or more lines are too long

View file

@ -519,8 +519,16 @@ Enums.InterfaceAnimation = {
/** /**
* @enum {number} * @enum {number}
*/ */
Enums.ContactScopeType = { Enums.Layout = {
'NoPreview': 0,
'SidePreview': 1,
'BottomPreview': 2
};
/**
* @enum {number}
*/
Enums.ContactScopeType = {
'Default': 0, 'Default': 0,
'ShareAll': 2 'ShareAll': 2
}; };
@ -1370,6 +1378,7 @@ Utils.initDataConstructorBySettings = function (oData)
oData.useThreads = ko.observable(true); oData.useThreads = ko.observable(true);
oData.replySameFolder = ko.observable(true); oData.replySameFolder = ko.observable(true);
oData.usePreviewPane = ko.observable(true); oData.usePreviewPane = ko.observable(true);
oData.layout = ko.observable(Enums.Layout.SidePreview);
oData.useCheckboxesInList = ko.observable(true); oData.useCheckboxesInList = ko.observable(true);
oData.interfaceAnimation.subscribe(function (sValue) { oData.interfaceAnimation.subscribe(function (sValue) {
@ -3096,6 +3105,14 @@ LinkBuilder.prototype.inbox = function ()
return this.sBase + 'mailbox/Inbox'; return this.sBase + 'mailbox/Inbox';
}; };
/**
* @return {string}
*/
LinkBuilder.prototype.messagePreview = function ()
{
return this.sBase + 'mailbox/message-preview';
};
/** /**
* @param {string=} sScreenName * @param {string=} sScreenName
* @return {string} * @return {string}
@ -11350,7 +11367,7 @@ function MailBoxMessageListViewModel()
this.dragOverBodyArea = ko.observable(null); this.dragOverBodyArea = ko.observable(null);
this.messageListItemTemplate = ko.computed(function () { this.messageListItemTemplate = ko.computed(function () {
return oData.usePreviewPane() ? return Enums.Layout.NoPreview !== oData.layout() ?
'MailMessageListItem' : 'MailMessageListItemNoPreviewPane'; 'MailMessageListItem' : 'MailMessageListItemNoPreviewPane';
}); });
@ -11465,6 +11482,11 @@ function MailBoxMessageListViewModel()
this.selector.on('onItemSelect', _.bind(function (oMessage) { this.selector.on('onItemSelect', _.bind(function (oMessage) {
if (oMessage) if (oMessage)
{ {
if (Enums.Layout.NoPreview === oData.layout())
{
kn.setHash(RL.link().messagePreview(), true);
}
oData.message(oData.staticMessageList.populateByMessageListItem(oMessage)); oData.message(oData.staticMessageList.populateByMessageListItem(oMessage));
this.populateMessageBody(oData.message()); this.populateMessageBody(oData.message());
} }
@ -12025,7 +12047,7 @@ MailBoxMessageListViewModel.prototype.onBuild = function (oDom)
if (oEvent && self.viewModelVisibility() && oData.useKeyboardShortcuts() && !RL.popupVisibility() && !oData.messageFullScreenMode() && !Utils.inFocus()) if (oEvent && self.viewModelVisibility() && oData.useKeyboardShortcuts() && !RL.popupVisibility() && !oData.messageFullScreenMode() && !Utils.inFocus())
{ {
if (oData.usePreviewPane() || (!oData.message() && (Enums.EventKeyCode.Delete === iKeyCode || Enums.EventKeyCode.A === iKeyCode))) if (Enums.Layout.NoPreview !== oData.layout() || (!oData.message() && (Enums.EventKeyCode.Delete === iKeyCode || Enums.EventKeyCode.A === iKeyCode)))
{ {
if (oEvent.ctrlKey && Enums.EventKeyCode.A === iKeyCode) if (oEvent.ctrlKey && Enums.EventKeyCode.A === iKeyCode)
{ {
@ -12243,7 +12265,7 @@ function MailBoxMessageViewViewModel()
this.messagesBodiesDom = oData.messagesBodiesDom; this.messagesBodiesDom = oData.messagesBodiesDom;
this.useThreads = oData.useThreads; this.useThreads = oData.useThreads;
this.replySameFolder = oData.replySameFolder; this.replySameFolder = oData.replySameFolder;
this.usePreviewPane = oData.usePreviewPane; this.layout = oData.layout;
this.isMessageSelected = oData.isMessageSelected; this.isMessageSelected = oData.isMessageSelected;
this.messageActiveDom = oData.messageActiveDom; this.messageActiveDom = oData.messageActiveDom;
this.messageError = oData.messageError; this.messageError = oData.messageError;
@ -12260,7 +12282,14 @@ function MailBoxMessageViewViewModel()
// commands // commands
this.closeMessage = Utils.createCommand(this, function () { this.closeMessage = Utils.createCommand(this, function () {
oData.message(null); if (Enums.Layout.NoPreview === oData.layout())
{
RL.historyBack();
}
else
{
oData.message(null);
}
}); });
this.replyCommand = createCommandHelper(Enums.ComposeType.Reply); this.replyCommand = createCommandHelper(Enums.ComposeType.Reply);
@ -12463,13 +12492,13 @@ MailBoxMessageViewViewModel.prototype.onBuild = function (oDom)
iKeyCode = oEvent ? oEvent.keyCode : 0 iKeyCode = oEvent ? oEvent.keyCode : 0
; ;
if (0 < iKeyCode && (Enums.EventKeyCode.Backspace === iKeyCode || Enums.EventKeyCode.Esc === iKeyCode) && if (0 < iKeyCode && (Enums.EventKeyCode.Esc === iKeyCode) &&
self.viewModelVisibility() && oData.useKeyboardShortcuts() && !Utils.inFocus() && oData.message()) self.viewModelVisibility() && oData.useKeyboardShortcuts() && !Utils.inFocus() && oData.message())
{ {
self.fullScreenMode(false); self.fullScreenMode(false);
if (!oData.usePreviewPane()) if (Enums.Layout.NoPreview === oData.layout())
{ {
oData.message(null); RL.historyBack();
} }
bResult = false; bResult = false;
@ -12665,6 +12694,7 @@ function SettingsGeneral()
this.useThreads = oData.useThreads; this.useThreads = oData.useThreads;
this.replySameFolder = oData.replySameFolder; this.replySameFolder = oData.replySameFolder;
this.usePreviewPane = oData.usePreviewPane; this.usePreviewPane = oData.usePreviewPane;
this.layout = oData.layout;
this.useCheckboxesInList = oData.useCheckboxesInList; this.useCheckboxesInList = oData.useCheckboxesInList;
this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings; this.allowLanguagesOnSettings = oData.allowLanguagesOnSettings;
@ -12782,6 +12812,15 @@ SettingsGeneral.prototype.onBuild = function ()
}); });
}); });
oData.layout.subscribe(function (nValue) {
oData.messageList([]);
RL.remote().saveSettings(Utils.emptyFunction, {
'Layout': nValue
});
});
oData.useCheckboxesInList.subscribe(function (bValue) { oData.useCheckboxesInList.subscribe(function (bValue) {
RL.remote().saveSettings(Utils.emptyFunction, { RL.remote().saveSettings(Utils.emptyFunction, {
'UseCheckboxesInList': bValue ? '1' : '0' 'UseCheckboxesInList': bValue ? '1' : '0'
@ -13683,6 +13722,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.useThreads(!!RL.settingsGet('UseThreads')); this.useThreads(!!RL.settingsGet('UseThreads'));
this.replySameFolder(!!RL.settingsGet('ReplySameFolder')); this.replySameFolder(!!RL.settingsGet('ReplySameFolder'));
this.usePreviewPane(!!RL.settingsGet('UsePreviewPane')); this.usePreviewPane(!!RL.settingsGet('UsePreviewPane'));
this.layout(!!RL.settingsGet('UsePreviewPane') ? Enums.Layout.SidePreview : Enums.Layout.NoPreview); // TODO
this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList')); this.useCheckboxesInList(!!RL.settingsGet('UseCheckboxesInList'));
this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial')); this.facebookEnable(!!RL.settingsGet('AllowFacebookSocial'));
@ -16318,17 +16358,27 @@ MailBoxScreen.prototype.onShow = function ()
* @param {string} sFolderHash * @param {string} sFolderHash
* @param {number} iPage * @param {number} iPage
* @param {string} sSearch * @param {string} sSearch
* @param {boolean=} bPreview = false
*/ */
MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch) MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPreview)
{ {
var if (Utils.isUnd(bPreview) ? false : !!bPreview)
oData = RL.data(),
sFolderFullNameRaw = RL.cache().getFolderFullNameRaw(sFolderHash),
oFolder = RL.cache().getFolderFromCacheList(sFolderFullNameRaw)
;
if (oFolder)
{ {
if (!RL.data().usePreviewPane() && !RL.data().message())
{
RL.historyBack();
}
}
else
{
var
oData = RL.data(),
sFolderFullNameRaw = RL.cache().getFolderFullNameRaw(sFolderHash),
oFolder = RL.cache().getFolderFromCacheList(sFolderFullNameRaw)
;
if (oFolder)
{
oData oData
.currentFolder(oFolder) .currentFolder(oFolder)
.messageListPage(iPage) .messageListPage(iPage)
@ -16338,10 +16388,12 @@ MailBoxScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch)
if (!oData.usePreviewPane() && oData.message()) if (!oData.usePreviewPane() && oData.message())
{ {
oData.message(null); oData.message(null);
oData.messageFullScreenMode(false);
} }
RL.reloadMessageList(); RL.reloadMessageList();
} }
}
}; };
MailBoxScreen.prototype.onStart = function () MailBoxScreen.prototype.onStart = function ()
@ -16405,6 +16457,9 @@ MailBoxScreen.prototype.onStart = function ()
MailBoxScreen.prototype.routes = function () MailBoxScreen.prototype.routes = function ()
{ {
var var
fNormP = function () {
return ['Inbox', 1, '', true];
},
fNormS = function (oRequest, oVals) { fNormS = function (oRequest, oVals) {
oVals[0] = Utils.pString(oVals[0]); oVals[0] = Utils.pString(oVals[0]);
oVals[1] = Utils.pInt(oVals[1]); oVals[1] = Utils.pInt(oVals[1]);
@ -16417,7 +16472,7 @@ MailBoxScreen.prototype.routes = function ()
oVals[1] = 1; oVals[1] = 1;
} }
return [decodeURI(oVals[0]), oVals[1], decodeURI(oVals[2])]; return [decodeURI(oVals[0]), oVals[1], decodeURI(oVals[2]), false];
}, },
fNormD = function (oRequest, oVals) { fNormD = function (oRequest, oVals) {
oVals[0] = Utils.pString(oVals[0]); oVals[0] = Utils.pString(oVals[0]);
@ -16428,7 +16483,7 @@ MailBoxScreen.prototype.routes = function ()
oVals[0] = 'Inbox'; oVals[0] = 'Inbox';
} }
return [decodeURI(oVals[0]), 1, decodeURI(oVals[1])]; return [decodeURI(oVals[0]), 1, decodeURI(oVals[1]), false];
} }
; ;
@ -16436,6 +16491,7 @@ MailBoxScreen.prototype.routes = function ()
[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/, {'normalize_': fNormS}], [/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/, {'normalize_': fNormS}],
[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/, {'normalize_': fNormS}], [/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/, {'normalize_': fNormS}],
[/^([a-zA-Z0-9]+)\/(.+)\/?$/, {'normalize_': fNormD}], [/^([a-zA-Z0-9]+)\/(.+)\/?$/, {'normalize_': fNormD}],
[/^message-preview$/, {'normalize_': fNormP}],
[/^([^\/]*)$/, {'normalize_': fNormS}] [/^([^\/]*)$/, {'normalize_': fNormS}]
]; ];
}; };
@ -16672,6 +16728,11 @@ AbstractApp.prototype.loginAndLogoutReload = function (bLogout, bClose)
} }
}; };
AbstractApp.prototype.historyBack = function ()
{
window.history.back();
};
/** /**
* @param {string} sQuery * @param {string} sQuery
* @param {Function} fCallback * @param {Function} fCallback

File diff suppressed because one or more lines are too long