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;
@ -134,6 +135,15 @@ SettingsGeneral.prototype.onBuild = function ()
'UsePreviewPane': bValue ? '1' : '0' 'UsePreviewPane': bValue ? '1' : '0'
}); });
}); });
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, {

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

@ -637,7 +637,7 @@
border-radius: 8px; border-radius: 8px;
} }
/*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */ /*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */
/* ============================================================================= /* =============================================================================
@ -1142,7 +1142,7 @@ table {
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
} }
@charset "UTF-8"; @charset "UTF-8";
@font-face { @font-face {
@ -1474,7 +1474,7 @@ table {
.icon-mail:before { .icon-mail:before {
content: "\e062"; content: "\e062";
} }
/** initial setup **/ /** initial setup **/
.nano { .nano {
/* /*
@ -1591,7 +1591,7 @@ table {
.nano > .pane2:hover > .slider2, .nano > .pane2.active > .slider2 { .nano > .pane2:hover > .slider2, .nano > .pane2.active > .slider2 {
background-color: rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.4);
} }
/* Magnific Popup CSS */ /* Magnific Popup CSS */
.mfp-bg { .mfp-bg {
top: 0; top: 0;
@ -1956,7 +1956,7 @@ img.mfp-img {
right: 0; right: 0;
padding-top: 0; } padding-top: 0; }
/* overlay at start */ /* overlay at start */
.mfp-fade.mfp-bg { .mfp-fade.mfp-bg {
@ -2002,7 +2002,7 @@ img.mfp-img {
-moz-transform: translateX(50px); -moz-transform: translateX(50px);
transform: translateX(50px); transform: translateX(50px);
} }
.simple-pace { .simple-pace {
-webkit-pointer-events: none; -webkit-pointer-events: none;
pointer-events: none; pointer-events: none;
@ -2073,7 +2073,7 @@ img.mfp-img {
@keyframes simple-pace-stripe-animation { @keyframes simple-pace-stripe-animation {
0% { transform: none; transform: none; } 0% { transform: none; transform: none; }
100% { transform: translate(-32px, 0); transform: translate(-32px, 0); } 100% { transform: translate(-32px, 0); transform: translate(-32px, 0); }
} }
.inputosaurus-container { .inputosaurus-container {
background-color:#fff; background-color:#fff;
border:1px solid #bcbec0; border:1px solid #bcbec0;
@ -2141,7 +2141,7 @@ img.mfp-img {
box-shadow:none; box-shadow:none;
} }
.inputosaurus-input-hidden { display:none; } .inputosaurus-input-hidden { display:none; }
.flag-wrapper { .flag-wrapper {
width: 24px; width: 24px;
height: 16px; height: 16px;
@ -2182,7 +2182,7 @@ img.mfp-img {
.flag.flag-pt-br {background-position: -192px -11px} .flag.flag-pt-br {background-position: -192px -11px}
.flag.flag-cn, .flag.flag-zh-tw, .flag.flag-zh-cn, .flag.flag-zh-hk {background-position: -208px -22px} .flag.flag-cn, .flag.flag-zh-tw, .flag.flag-zh-cn, .flag.flag-zh-hk {background-position: -208px -22px}
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
.clearfix { .clearfix {
*zoom: 1; *zoom: 1;

View file

@ -1,5 +1,5 @@
/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (window, $, ko, crossroads, hasher, _) { (function (window, $, ko, crossroads, hasher, _) {
'use strict'; 'use strict';
@ -70,14 +70,14 @@ var
$document = $(window.document), $document = $(window.document),
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
; ;
/*jshint onevar: false*/ /*jshint onevar: false*/
/** /**
* @type {?AdminApp} * @type {?AdminApp}
*/ */
var RL = null; var RL = null;
/*jshint onevar: true*/ /*jshint onevar: true*/
/** /**
* @type {?} * @type {?}
*/ */
@ -164,7 +164,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type; return oType && 'application/pdf' === oType.type;
}); });
} }
Consts.Defaults = {}; Consts.Defaults = {};
Consts.Values = {}; Consts.Values = {};
Consts.DataImages = {}; Consts.DataImages = {};
@ -282,7 +282,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string} * @type {string}
*/ */
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII='; Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/** /**
* @enum {string} * @enum {string}
*/ */
@ -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
}; };
@ -618,7 +626,7 @@ Enums.Notification = {
'UnknownNotification': 999, 'UnknownNotification': 999,
'UnknownError': 999 'UnknownError': 999
}; };
Utils.trim = $.trim; Utils.trim = $.trim;
Utils.inArray = $.inArray; Utils.inArray = $.inArray;
Utils.isArray = _.isArray; Utils.isArray = _.isArray;
@ -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) {
@ -2184,7 +2193,7 @@ Utils.computedPagenatorHelper = function (koCurrentPage, koPageCount)
return aResult; return aResult;
}; };
}; };
// Base64 encode / decode // Base64 encode / decode
// http://www.webtoolkit.info/ // http://www.webtoolkit.info/
@ -2347,7 +2356,7 @@ Base64 = {
} }
}; };
/*jslint bitwise: false*/ /*jslint bitwise: false*/
ko.bindingHandlers.tooltip = { ko.bindingHandlers.tooltip = {
'init': function (oElement, fValueAccessor) { 'init': function (oElement, fValueAccessor) {
if (!Globals.bMobileDevice) if (!Globals.bMobileDevice)
@ -2969,7 +2978,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this; return this;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -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}
@ -3259,7 +3276,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{ {
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : ''); return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
}; };
/** /**
* @type {Object} * @type {Object}
*/ */
@ -3353,7 +3370,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
}; };
/** /**
* @constructor * @constructor
*/ */
@ -3427,7 +3444,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult; return mResult;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -3499,7 +3516,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult; return mResult;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -3542,7 +3559,7 @@ LocalStorage.prototype.get = function (iKey)
{ {
return this.oDriver ? this.oDriver.get('p' + iKey) : null; return this.oDriver ? this.oDriver.get('p' + iKey) : null;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -3555,7 +3572,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{ {
}; };
/** /**
* @param {string=} sPosition = '' * @param {string=} sPosition = ''
* @param {string=} sTemplate = '' * @param {string=} sTemplate = ''
@ -3615,7 +3632,7 @@ KnoinAbstractViewModel.prototype.viewModelPosition = function ()
KnoinAbstractViewModel.prototype.cancelCommand = KnoinAbstractViewModel.prototype.closeCommand = function () KnoinAbstractViewModel.prototype.cancelCommand = KnoinAbstractViewModel.prototype.closeCommand = function ()
{ {
}; };
/** /**
* @param {string} sScreenName * @param {string} sScreenName
* @param {?=} aViewModels = [] * @param {?=} aViewModels = []
@ -3691,7 +3708,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute; this.oCross = oRoute;
} }
}; };
/** /**
* @constructor * @constructor
*/ */
@ -4082,7 +4099,7 @@ Knoin.prototype.bootstart = function ()
}; };
kn = new Knoin(); kn = new Knoin();
/** /**
* @param {string=} sEmail * @param {string=} sEmail
* @param {string=} sName * @param {string=} sName
@ -4446,7 +4463,7 @@ EmailModel.prototype.inputoTagLine = function ()
{ {
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email; return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -4666,7 +4683,7 @@ PopupsDomainViewModel.prototype.clearForm = function ()
this.smtpAuth(true); this.smtpAuth(true);
this.whiteList(''); this.whiteList('');
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -4803,7 +4820,7 @@ PopupsPluginViewModel.prototype.onBuild = function ()
return bResult; return bResult;
}); });
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -4919,7 +4936,7 @@ PopupsActivateViewModel.prototype.validateSubscriptionKey = function ()
{ {
var sValue = this.key(); var sValue = this.key();
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue)); return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -4993,7 +5010,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang); RL.data().mainLanguage(sLang);
this.cancelCommand(); this.cancelCommand();
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -5111,7 +5128,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}); });
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -5198,7 +5215,7 @@ AdminLoginViewModel.prototype.onHide = function ()
{ {
this.loginFocus(false); this.loginFocus(false);
}; };
/** /**
* @param {?} oScreen * @param {?} oScreen
* *
@ -5220,7 +5237,7 @@ AdminMenuViewModel.prototype.link = function (sRoute)
{ {
return '#/' + sRoute; return '#/' + sRoute;
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -5242,7 +5259,7 @@ AdminPaneViewModel.prototype.logoutClick = function ()
RL.remote().adminLogout(function () { RL.remote().adminLogout(function () {
RL.loginAndLogoutReload(); RL.loginAndLogoutReload();
}); });
}; };
/** /**
* @constructor * @constructor
*/ */
@ -5342,7 +5359,7 @@ AdminGeneral.prototype.selectLanguage = function ()
{ {
kn.showScreenPopup(PopupsLanguagesViewModel); kn.showScreenPopup(PopupsLanguagesViewModel);
}; };
/** /**
* @constructor * @constructor
*/ */
@ -5394,7 +5411,7 @@ AdminLogin.prototype.onBuild = function ()
}, 50); }, 50);
}; };
/** /**
* @constructor * @constructor
*/ */
@ -5463,7 +5480,7 @@ AdminBranding.prototype.onBuild = function ()
}, 50); }, 50);
}; };
/** /**
* @constructor * @constructor
*/ */
@ -5683,7 +5700,7 @@ AdminContacts.prototype.onBuild = function ()
}, 50); }, 50);
}; };
/** /**
* @constructor * @constructor
*/ */
@ -5772,7 +5789,7 @@ AdminDomains.prototype.onDomainListChangeRequest = function ()
{ {
RL.reloadDomainList(); RL.reloadDomainList();
}; };
/** /**
* @constructor * @constructor
*/ */
@ -5860,7 +5877,7 @@ AdminSecurity.prototype.phpInfoLink = function ()
{ {
return RL.link().phpInfo(); return RL.link().phpInfo();
}; };
/** /**
* @constructor * @constructor
*/ */
@ -5976,7 +5993,7 @@ AdminSocial.prototype.onBuild = function ()
}, 50); }, 50);
}; };
/** /**
* @constructor * @constructor
*/ */
@ -6073,7 +6090,7 @@ AdminPlugins.prototype.onPluginDisableRequest = function (sResult, oData)
RL.reloadPluginList(); RL.reloadPluginList();
}; };
/** /**
* @constructor * @constructor
*/ */
@ -6177,7 +6194,7 @@ AdminPackages.prototype.installPackage = function (oPackage)
RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage); RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage);
} }
}; };
/** /**
* @constructor * @constructor
*/ */
@ -6228,7 +6245,7 @@ AdminLicensing.prototype.licenseExpiredMomentValue = function ()
{ {
var oDate = moment.unix(this.licenseExpired()); var oDate = moment.unix(this.licenseExpired());
return oDate.format('LL') + ' (' + oDate.from(moment()) + ')'; return oDate.format('LL') + ' (' + oDate.from(moment()) + ')';
}; };
/** /**
* @constructor * @constructor
*/ */
@ -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'));
@ -6297,7 +6315,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed')); this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
}; };
/** /**
* @constructor * @constructor
* @extends AbstractData * @extends AbstractData
@ -6331,7 +6349,7 @@ _.extend(AdminDataStorage.prototype, AbstractData.prototype);
AdminDataStorage.prototype.populateDataOnStart = function() AdminDataStorage.prototype.populateDataOnStart = function()
{ {
AbstractData.prototype.populateDataOnStart.call(this); AbstractData.prototype.populateDataOnStart.call(this);
}; };
/** /**
* @constructor * @constructor
*/ */
@ -6605,7 +6623,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion 'Version': sVersion
}); });
}; };
/** /**
* @constructor * @constructor
* @extends AbstractAjaxRemoteStorage * @extends AbstractAjaxRemoteStorage
@ -6849,7 +6867,7 @@ AdminAjaxRemoteStorage.prototype.adminPing = function (fCallback)
{ {
this.defaultRequest(fCallback, 'AdminPing'); this.defaultRequest(fCallback, 'AdminPing');
}; };
/** /**
* @constructor * @constructor
*/ */
@ -6915,7 +6933,7 @@ AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
{ {
this.oEmailsPicsHashes = oData; this.oEmailsPicsHashes = oData;
}; };
/** /**
* @constructor * @constructor
* @extends AbstractCacheStorage * @extends AbstractCacheStorage
@ -6926,7 +6944,7 @@ function AdminCacheStorage()
} }
_.extend(AdminCacheStorage.prototype, AbstractCacheStorage.prototype); _.extend(AdminCacheStorage.prototype, AbstractCacheStorage.prototype);
/** /**
* @param {Array} aViewModels * @param {Array} aViewModels
* @constructor * @constructor
@ -7103,7 +7121,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules] ['', oRules]
]; ];
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractScreen * @extends KnoinAbstractScreen
@ -7118,7 +7136,7 @@ _.extend(AdminLoginScreen.prototype, KnoinAbstractScreen.prototype);
AdminLoginScreen.prototype.onShow = function () AdminLoginScreen.prototype.onShow = function ()
{ {
RL.setTitle(''); RL.setTitle('');
}; };
/** /**
* @constructor * @constructor
* @extends AbstractSettings * @extends AbstractSettings
@ -7138,7 +7156,7 @@ AdminSettingsScreen.prototype.onShow = function ()
// AbstractSettings.prototype.onShow.call(this); // AbstractSettings.prototype.onShow.call(this);
RL.setTitle(''); RL.setTitle('');
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractBoot * @extends KnoinAbstractBoot
@ -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
@ -7449,7 +7472,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready(); ssm.ready();
}; };
/** /**
* @constructor * @constructor
* @extends AbstractApp * @extends AbstractApp
@ -7696,7 +7719,7 @@ AdminApp.prototype.bootstart = function ()
* @type {AdminApp} * @type {AdminApp}
*/ */
RL = new AdminApp(); RL = new AdminApp();
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile'); $html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
$window.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS); $window.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS);
@ -7743,9 +7766,9 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null; window['__RLBOOT'] = null;
}); });
}; };
if (window.SimplePace) { if (window.SimplePace) {
window.SimplePace.add(10); window.SimplePace.add(10);
} }
}(window, jQuery, ko, crossroads, hasher, _)); }(window, jQuery, ko, crossroads, hasher, _));

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (window, $, ko, crossroads, hasher, moment, Jua, _, ifvisible) { (function (window, $, ko, crossroads, hasher, moment, Jua, _, ifvisible) {
'use strict'; 'use strict';
@ -70,14 +70,14 @@ var
$document = $(window.document), $document = $(window.document),
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
; ;
/*jshint onevar: false*/ /*jshint onevar: false*/
/** /**
* @type {?RainLoopApp} * @type {?RainLoopApp}
*/ */
var RL = null; var RL = null;
/*jshint onevar: true*/ /*jshint onevar: true*/
/** /**
* @type {?} * @type {?}
*/ */
@ -164,7 +164,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type; return oType && 'application/pdf' === oType.type;
}); });
} }
Consts.Defaults = {}; Consts.Defaults = {};
Consts.Values = {}; Consts.Values = {};
Consts.DataImages = {}; Consts.DataImages = {};
@ -282,7 +282,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string} * @type {string}
*/ */
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII='; Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/** /**
* @enum {string} * @enum {string}
*/ */
@ -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
}; };
@ -618,7 +626,7 @@ Enums.Notification = {
'UnknownNotification': 999, 'UnknownNotification': 999,
'UnknownError': 999 'UnknownError': 999
}; };
Utils.trim = $.trim; Utils.trim = $.trim;
Utils.inArray = $.inArray; Utils.inArray = $.inArray;
Utils.isArray = _.isArray; Utils.isArray = _.isArray;
@ -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) {
@ -2184,7 +2193,7 @@ Utils.computedPagenatorHelper = function (koCurrentPage, koPageCount)
return aResult; return aResult;
}; };
}; };
// Base64 encode / decode // Base64 encode / decode
// http://www.webtoolkit.info/ // http://www.webtoolkit.info/
@ -2347,7 +2356,7 @@ Base64 = {
} }
}; };
/*jslint bitwise: false*/ /*jslint bitwise: false*/
ko.bindingHandlers.tooltip = { ko.bindingHandlers.tooltip = {
'init': function (oElement, fValueAccessor) { 'init': function (oElement, fValueAccessor) {
if (!Globals.bMobileDevice) if (!Globals.bMobileDevice)
@ -2969,7 +2978,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this; return this;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -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}
@ -3259,7 +3276,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{ {
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : ''); return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
}; };
/** /**
* @type {Object} * @type {Object}
*/ */
@ -3353,7 +3370,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
}; };
/** /**
* @constructor * @constructor
*/ */
@ -4249,7 +4266,7 @@ HtmlEditor.htmlFunctions = {
}, this), this.toolbar); }, this), this.toolbar);
} }
}; };
/** /**
* @constructor * @constructor
* @param {koProperty} oKoList * @param {koProperty} oKoList
@ -4790,7 +4807,7 @@ Selector.prototype.on = function (sEventName, fCallback)
{ {
this.oCallbacks[sEventName] = fCallback; this.oCallbacks[sEventName] = fCallback;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -4864,7 +4881,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult; return mResult;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -4936,7 +4953,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult; return mResult;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -4979,7 +4996,7 @@ LocalStorage.prototype.get = function (iKey)
{ {
return this.oDriver ? this.oDriver.get('p' + iKey) : null; return this.oDriver ? this.oDriver.get('p' + iKey) : null;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -4992,7 +5009,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{ {
}; };
/** /**
* @param {string=} sPosition = '' * @param {string=} sPosition = ''
* @param {string=} sTemplate = '' * @param {string=} sTemplate = ''
@ -5052,7 +5069,7 @@ KnoinAbstractViewModel.prototype.viewModelPosition = function ()
KnoinAbstractViewModel.prototype.cancelCommand = KnoinAbstractViewModel.prototype.closeCommand = function () KnoinAbstractViewModel.prototype.cancelCommand = KnoinAbstractViewModel.prototype.closeCommand = function ()
{ {
}; };
/** /**
* @param {string} sScreenName * @param {string} sScreenName
* @param {?=} aViewModels = [] * @param {?=} aViewModels = []
@ -5128,7 +5145,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute; this.oCross = oRoute;
} }
}; };
/** /**
* @constructor * @constructor
*/ */
@ -5519,7 +5536,7 @@ Knoin.prototype.bootstart = function ()
}; };
kn = new Knoin(); kn = new Knoin();
/** /**
* @param {string=} sEmail * @param {string=} sEmail
* @param {string=} sName * @param {string=} sName
@ -5883,7 +5900,7 @@ EmailModel.prototype.inputoTagLine = function ()
{ {
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email; return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -6005,7 +6022,7 @@ ContactModel.prototype.lineAsCcc = function ()
return aResult.join(' '); return aResult.join(' ');
}; };
/** /**
* @param {number=} iType = Enums.ContactPropertyType.Unknown * @param {number=} iType = Enums.ContactPropertyType.Unknown
* @param {string=} sValue = '' * @param {string=} sValue = ''
@ -6027,7 +6044,7 @@ function ContactPropertyModel(iType, sValue, bFocused, sPlaceholder)
return sPlaceholder ? Utils.i18n(sPlaceholder) : ''; return sPlaceholder ? Utils.i18n(sPlaceholder) : '';
}, this); }, this);
} }
/** /**
* @constructor * @constructor
*/ */
@ -6263,7 +6280,7 @@ AttachmentModel.prototype.iconClass = function ()
return sClass; return sClass;
}; };
/** /**
* @constructor * @constructor
* @param {string} sId * @param {string} sId
@ -6324,7 +6341,7 @@ ComposeAttachmentModel.prototype.initByUploadJson = function (oJsonAttachment)
} }
return bResult; return bResult;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -7302,7 +7319,7 @@ MessageModel.prototype.showInternalImages = function (bLazy)
Utils.windowResize(500); Utils.windowResize(500);
} }
}; };
/** /**
* @constructor * @constructor
*/ */
@ -7636,7 +7653,7 @@ FolderModel.prototype.printableFullName = function ()
{ {
return this.fullName.split(this.delimiter).join(' / '); return this.fullName.split(this.delimiter).join(' / ');
}; };
/** /**
* @param {string} sEmail * @param {string} sEmail
* @param {boolean=} bCanBeDelete = true * @param {boolean=} bCanBeDelete = true
@ -7657,7 +7674,7 @@ AccountModel.prototype.email = '';
AccountModel.prototype.changeAccountLink = function () AccountModel.prototype.changeAccountLink = function ()
{ {
return RL.link().change(this.email); return RL.link().change(this.email);
}; };
/** /**
* @param {string} sId * @param {string} sId
* @param {string} sEmail * @param {string} sEmail
@ -7693,7 +7710,7 @@ IdentityModel.prototype.formattedNameForEmail = function ()
var sName = this.name(); var sName = this.name();
return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>'; return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>';
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -7803,7 +7820,7 @@ PopupsFolderClearViewModel.prototype.onBuild = function ()
return bResult; return bResult;
}); });
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -7927,7 +7944,7 @@ PopupsFolderCreateViewModel.prototype.onBuild = function ()
return bResult; return bResult;
}); });
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -8046,7 +8063,7 @@ PopupsFolderSystemViewModel.prototype.onBuild = function ()
}); });
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -9494,7 +9511,7 @@ PopupsComposeViewModel.prototype.triggerForResize = function ()
this.resizer(!this.resizer()); this.resizer(!this.resizer());
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -10134,7 +10151,7 @@ PopupsContactsViewModel.prototype.onHide = function ()
oItem.checked(false); oItem.checked(false);
}); });
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -10278,7 +10295,7 @@ PopupsAdvancedSearchViewModel.prototype.onBuild = function ()
return bResult; return bResult;
}); });
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -10406,7 +10423,7 @@ PopupsAddAccountViewModel.prototype.onBuild = function ()
return bResult; return bResult;
}); });
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -10568,7 +10585,7 @@ PopupsIdentityViewModel.prototype.onBuild = function ()
return bResult; return bResult;
}); });
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -10642,7 +10659,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang); RL.data().mainLanguage(sLang);
this.cancelCommand(); this.cancelCommand();
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -10760,7 +10777,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}); });
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -10823,7 +10840,7 @@ PopupsPgpKey.prototype.onShow = function (bPrivate, fCallback)
this.bPrivate = bPrivate; this.bPrivate = bPrivate;
this.fCallback = fCallback; this.fCallback = fCallback;
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -11095,7 +11112,7 @@ LoginViewModel.prototype.selectLanguage = function ()
kn.showScreenPopup(PopupsLanguagesViewModel); kn.showScreenPopup(PopupsLanguagesViewModel);
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -11162,7 +11179,7 @@ AbstractSystemDropDownViewModel.prototype.logoutClick = function ()
RL.loginAndLogoutReload(true, RL.settingsGet('ParentEmail') && 0 < RL.settingsGet('ParentEmail').length); RL.loginAndLogoutReload(true, RL.settingsGet('ParentEmail') && 0 < RL.settingsGet('ParentEmail').length);
}); });
}; };
/** /**
* @constructor * @constructor
* @extends AbstractSystemDropDownViewModel * @extends AbstractSystemDropDownViewModel
@ -11174,7 +11191,7 @@ function MailBoxSystemDropDownViewModel()
} }
Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel); Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/** /**
* @constructor * @constructor
* @extends AbstractSystemDropDownViewModel * @extends AbstractSystemDropDownViewModel
@ -11186,7 +11203,7 @@ function SettingsSystemDropDownViewModel()
} }
Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel); Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -11301,7 +11318,7 @@ MailBoxFolderListViewModel.prototype.contactsClick = function ()
kn.showScreenPopup(PopupsContactsViewModel); kn.showScreenPopup(PopupsContactsViewModel);
} }
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -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)
{ {
@ -12215,7 +12237,7 @@ MailBoxMessageListViewModel.prototype.initUploaderForAppend = function ()
; ;
return !!oJua; return !!oJua;
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -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;
@ -12596,7 +12625,7 @@ MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage)
RL.reloadFlagsCurrentMessageListAndMessageFromCache(); RL.reloadFlagsCurrentMessageListAndMessageFromCache();
} }
}; };
/** /**
* @param {?} oScreen * @param {?} oScreen
* *
@ -12623,7 +12652,7 @@ SettingsMenuViewModel.prototype.backToMailBoxClick = function ()
{ {
kn.setHash(RL.link().inbox()); kn.setHash(RL.link().inbox());
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractViewModel * @extends KnoinAbstractViewModel
@ -12646,7 +12675,7 @@ SettingsPaneViewModel.prototype.backToMailBoxClick = function ()
{ {
kn.setHash(RL.link().inbox()); kn.setHash(RL.link().inbox());
}; };
/** /**
* @constructor * @constructor
*/ */
@ -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;
@ -12781,6 +12811,15 @@ SettingsGeneral.prototype.onBuild = function ()
'UsePreviewPane': bValue ? '1' : '0' 'UsePreviewPane': bValue ? '1' : '0'
}); });
}); });
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, {
@ -12800,7 +12839,7 @@ SettingsGeneral.prototype.selectLanguage = function ()
{ {
kn.showScreenPopup(PopupsLanguagesViewModel); kn.showScreenPopup(PopupsLanguagesViewModel);
}; };
/** /**
* @constructor * @constructor
*/ */
@ -12838,7 +12877,7 @@ SettingsContacts.prototype.onShow = function ()
{ {
this.showPassword(false); this.showPassword(false);
}; };
/** /**
* @constructor * @constructor
*/ */
@ -12904,7 +12943,7 @@ SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove)
} }
} }
}; };
/** /**
* @constructor * @constructor
*/ */
@ -12962,7 +13001,7 @@ SettingsIdentity.prototype.onBuild = function ()
}, 50); }, 50);
}; };
/** /**
* @constructor * @constructor
*/ */
@ -13090,7 +13129,7 @@ SettingsIdentities.prototype.onBuild = function (oDom)
}); });
}, 50); }, 50);
}; };
/** /**
* @constructor * @constructor
*/ */
@ -13157,7 +13196,7 @@ function SettingsSocialScreen()
} }
Utils.addSettingsViewModel(SettingsSocialScreen, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social'); Utils.addSettingsViewModel(SettingsSocialScreen, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
/** /**
* @constructor * @constructor
*/ */
@ -13221,7 +13260,7 @@ SettingsChangePasswordScreen.prototype.onChangePasswordResponse = function (sRes
this.passwordUpdateError(true); this.passwordUpdateError(true);
} }
}; };
/** /**
* @constructor * @constructor
*/ */
@ -13416,7 +13455,7 @@ SettingsFolders.prototype.unSubscribeFolder = function (oFolder)
oFolder.subScribed(false); oFolder.subScribed(false);
}; };
/** /**
* @constructor * @constructor
*/ */
@ -13633,7 +13672,7 @@ SettingsThemes.prototype.initCustomThemeUploader = function ()
return false; return false;
}; };
/** /**
* @constructor * @constructor
*/ */
@ -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'));
@ -13702,7 +13742,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed')); this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
}; };
/** /**
* @constructor * @constructor
* @extends AbstractData * @extends AbstractData
@ -14724,7 +14764,7 @@ WebMailDataStorage.prototype.setMessageList = function (oData, bCached)
)); ));
} }
}; };
/** /**
* @constructor * @constructor
*/ */
@ -14998,7 +15038,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion 'Version': sVersion
}); });
}; };
/** /**
* @constructor * @constructor
* @extends AbstractAjaxRemoteStorage * @extends AbstractAjaxRemoteStorage
@ -15698,7 +15738,7 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback)
this.defaultRequest(fCallback, 'SocialUsers'); this.defaultRequest(fCallback, 'SocialUsers');
}; };
/** /**
* @constructor * @constructor
*/ */
@ -15764,7 +15804,7 @@ AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
{ {
this.oEmailsPicsHashes = oData; this.oEmailsPicsHashes = oData;
}; };
/** /**
* @constructor * @constructor
* @extends AbstractCacheStorage * @extends AbstractCacheStorage
@ -16082,7 +16122,7 @@ WebMailCacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function
this.setMessageFlagsToCache(sFolder, sUid, aFlags); this.setMessageFlagsToCache(sFolder, sUid, aFlags);
} }
}; };
/** /**
* @param {Array} aViewModels * @param {Array} aViewModels
* @constructor * @constructor
@ -16259,7 +16299,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules] ['', oRules]
]; ];
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractScreen * @extends KnoinAbstractScreen
@ -16274,7 +16314,7 @@ _.extend(LoginScreen.prototype, KnoinAbstractScreen.prototype);
LoginScreen.prototype.onShow = function () LoginScreen.prototype.onShow = function ()
{ {
RL.setTitle(''); RL.setTitle('');
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractScreen * @extends KnoinAbstractScreen
@ -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,10 +16491,11 @@ 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}]
]; ];
}; };
/** /**
* @constructor * @constructor
* @extends AbstractSettings * @extends AbstractSettings
@ -16467,7 +16523,7 @@ SettingsScreen.prototype.onShow = function ()
RL.setTitle(this.sSettingsTitle); RL.setTitle(this.sSettingsTitle);
}; };
/** /**
* @constructor * @constructor
* @extends KnoinAbstractBoot * @extends KnoinAbstractBoot
@ -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
@ -16778,7 +16839,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready(); ssm.ready();
}; };
/** /**
* @constructor * @constructor
* @extends AbstractApp * @extends AbstractApp
@ -17724,7 +17785,7 @@ RainLoopApp.prototype.bootstart = function ()
* @type {RainLoopApp} * @type {RainLoopApp}
*/ */
RL = new RainLoopApp(); RL = new RainLoopApp();
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile'); $html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
$window.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS); $window.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS);
@ -17771,9 +17832,9 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null; window['__RLBOOT'] = null;
}); });
}; };
if (window.SimplePace) { if (window.SimplePace) {
window.SimplePace.add(10); window.SimplePace.add(10);
} }
}(window, jQuery, ko, crossroads, hasher, moment, Jua, _, ifvisible)); }(window, jQuery, ko, crossroads, hasher, moment, Jua, _, ifvisible));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long