mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Interface fixes
This commit is contained in:
parent
bce1abd024
commit
3090b44dae
23 changed files with 388 additions and 248 deletions
|
|
@ -7,8 +7,10 @@
|
|||
window = require('window'),
|
||||
_ = require('_'),
|
||||
$ = require('$'),
|
||||
key = require('key'),
|
||||
|
||||
Globals = require('Common/Globals'),
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Links = require('Common/Links'),
|
||||
Events = require('Common/Events'),
|
||||
|
|
@ -96,6 +98,10 @@
|
|||
Globals.$doc.on('mousemove keypress click', _.debounce(function () {
|
||||
Events.pub('rl.auto-logout-refresh');
|
||||
}, 5000));
|
||||
|
||||
key('esc, enter', Enums.KeyState.All, _.bind(function () {
|
||||
Utils.detectDropdownVisibility();
|
||||
}, this));
|
||||
}
|
||||
|
||||
_.extend(AbstractApp.prototype, AbstractBoot.prototype);
|
||||
|
|
@ -350,8 +356,6 @@
|
|||
|
||||
ssm.ready();
|
||||
|
||||
|
||||
|
||||
require('Stores/Language').populate();
|
||||
require('Stores/Theme').populate();
|
||||
require('Stores/Social').populate();
|
||||
|
|
|
|||
|
|
@ -258,6 +258,7 @@
|
|||
});
|
||||
|
||||
Globals.keyScopeReal.subscribe(function (sValue) {
|
||||
// window.console.log(sValue);
|
||||
key.setScope(sValue);
|
||||
});
|
||||
|
||||
|
|
|
|||
13
dev/External/ko.js
vendored
13
dev/External/ko.js
vendored
|
|
@ -131,6 +131,11 @@
|
|||
if (Globals && Globals.aBootstrapDropdowns)
|
||||
{
|
||||
Globals.aBootstrapDropdowns.push($(oElement));
|
||||
|
||||
$(oElement).click(function () {
|
||||
require('Common/Utils').detectDropdownVisibility();
|
||||
});
|
||||
|
||||
// ko.utils.domNodeDisposal.addDisposeCallback(oElement, function () {
|
||||
// });
|
||||
}
|
||||
|
|
@ -141,17 +146,13 @@
|
|||
'update': function (oElement, fValueAccessor) {
|
||||
if (ko.unwrap(fValueAccessor()))
|
||||
{
|
||||
var
|
||||
$oEl = $(oElement),
|
||||
Utils = require('Common/Utils')
|
||||
;
|
||||
|
||||
var $oEl = $(oElement);
|
||||
if (!$oEl.hasClass('open'))
|
||||
{
|
||||
$oEl.find('.dropdown-toggle').dropdown('toggle');
|
||||
Utils.detectDropdownVisibility();
|
||||
}
|
||||
|
||||
require('Common/Utils').detectDropdownVisibility();
|
||||
fValueAccessor()(false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -649,10 +649,10 @@
|
|||
{
|
||||
aResult.push('emptySubject');
|
||||
}
|
||||
if (1 < this.threadsLen())
|
||||
{
|
||||
aResult.push('hasChildrenMessage');
|
||||
}
|
||||
// if (1 < this.threadsLen())
|
||||
// {
|
||||
// aResult.push('hasChildrenMessage');
|
||||
// }
|
||||
if (this.hasUnseenSubMessage())
|
||||
{
|
||||
aResult.push('hasUnseenSubMessage');
|
||||
|
|
|
|||
93
dev/Model/MessageSimple.js
Normal file
93
dev/Model/MessageSimple.js
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
_ = require('_'),
|
||||
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
MessageModel = require('Model/Message'),
|
||||
|
||||
AbstractModel = require('Knoin/AbstractModel')
|
||||
;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function MessageSimpleModel()
|
||||
{
|
||||
AbstractModel.call(this, 'MessageSimpleModel');
|
||||
|
||||
this.selected = false;
|
||||
|
||||
this.folderFullNameRaw = '';
|
||||
this.uid = '';
|
||||
this.size = 0;
|
||||
|
||||
this.sender = '';
|
||||
this.subject = '';
|
||||
|
||||
this.dateUTC = 0;
|
||||
}
|
||||
|
||||
_.extend(MessageSimpleModel.prototype, AbstractModel.prototype);
|
||||
|
||||
/**
|
||||
* @static
|
||||
* @param {AjaxJsonMessage} oJsonMessage
|
||||
* @return {?MessageSimpleModel}
|
||||
*/
|
||||
MessageSimpleModel.newInstanceFromJson = function (oJsonMessage)
|
||||
{
|
||||
var oMessageModel = new MessageSimpleModel();
|
||||
return oMessageModel.initByJson(oJsonMessage) ? oMessageModel : null;
|
||||
};
|
||||
|
||||
MessageSimpleModel.prototype.clear = function ()
|
||||
{
|
||||
this.selected = false;
|
||||
|
||||
this.folderFullNameRaw = '';
|
||||
this.uid = '';
|
||||
this.size = 0;
|
||||
|
||||
this.sender = '';
|
||||
this.subject = '';
|
||||
|
||||
this.dateUTC = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {AjaxJsonMessage} oJsonMessage
|
||||
* @return {boolean}
|
||||
*/
|
||||
MessageSimpleModel.prototype.initByJson = function (oJsonMessage)
|
||||
{
|
||||
var bResult = false;
|
||||
|
||||
if (oJsonMessage && 'Object/Message' === oJsonMessage['@Object'])
|
||||
{
|
||||
this.selected = false;
|
||||
|
||||
this.folderFullNameRaw = oJsonMessage.Folder;
|
||||
this.uid = oJsonMessage.Uid;
|
||||
this.size = Utils.pInt(oJsonMessage.Size);
|
||||
|
||||
this.sender = MessageModel.emailsToLine(
|
||||
MessageModel.initEmailsFromJson(oJsonMessage.From), true);
|
||||
|
||||
this.subject = oJsonMessage.Subject;
|
||||
|
||||
this.dateUTC = Utils.pInt(oJsonMessage.DateTimeStampInUTC);
|
||||
|
||||
bResult = true;
|
||||
}
|
||||
|
||||
return bResult;
|
||||
};
|
||||
|
||||
module.exports = MessageSimpleModel;
|
||||
|
||||
}());
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
return this;
|
||||
};
|
||||
|
||||
AbstractAjaxPromises.prototype.fastPromise = function (mData)
|
||||
AbstractAjaxPromises.prototype.fastResolve = function (mData)
|
||||
{
|
||||
var oDeferred = Q.defer();
|
||||
oDeferred.resolve(mData);
|
||||
|
|
|
|||
|
|
@ -5,11 +5,8 @@
|
|||
|
||||
var
|
||||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
|
||||
AbstractAjaxPromises = require('Promises/AbstractAjax'),
|
||||
|
||||
MessageModel = require('Model/Message')
|
||||
AbstractAjaxPromises = require('Promises/AbstractAjax')
|
||||
;
|
||||
|
||||
/**
|
||||
|
|
@ -20,39 +17,41 @@
|
|||
{
|
||||
AbstractAjaxPromises.call(this);
|
||||
|
||||
this.messageListSimple.loading = ko.observable(false).extend({'rateLimit': 1});
|
||||
this.messageListSimple.hash = '';
|
||||
this.messageListSimple.cache = null;
|
||||
this.messageListSimpleHash = '';
|
||||
this.messageListSimpleCache = null;
|
||||
}
|
||||
|
||||
PromisesUserAjax.prototype.messageListSimple = function (sFolder, aUids)
|
||||
_.extend(PromisesUserAjax.prototype, AbstractAjaxPromises.prototype);
|
||||
|
||||
PromisesUserAjax.prototype.messageListSimple = function (sFolder, aUids, fTrigger)
|
||||
{
|
||||
var self = this, sHash = sFolder + '~' + aUids.join('/');
|
||||
if (sHash === this.messageListSimple.hash && this.messageListSimple.cache)
|
||||
if (sHash === this.messageListSimpleHash && this.messageListSimpleCache)
|
||||
{
|
||||
return this.fastPromise(this.messageListSimple.cache);
|
||||
return this.fastResolve(this.messageListSimpleCache);
|
||||
}
|
||||
|
||||
return this.abort('MessageListSimple')
|
||||
.postRequest('MessageListSimple', this.messageListSimple.loading, {
|
||||
.postRequest('MessageListSimple', fTrigger, {
|
||||
'Folder': sFolder,
|
||||
'Uids': aUids
|
||||
}).then(function (aData) {
|
||||
|
||||
var aResult = _.compact(_.map(aData, function (aItem) {
|
||||
return MessageModel.newInstanceFromJson(aItem);
|
||||
}));
|
||||
var
|
||||
MessageSimpleModel = require('Model/MessageSimple'),
|
||||
aResult = _.compact(_.map(aData, function (aItem) {
|
||||
return MessageSimpleModel.newInstanceFromJson(aItem);
|
||||
}))
|
||||
;
|
||||
|
||||
self.messageListSimple.hash = sHash;
|
||||
self.messageListSimple.cache = aResult;
|
||||
self.messageListSimpleHash = sHash;
|
||||
self.messageListSimpleCache = aResult;
|
||||
|
||||
return aResult;
|
||||
})
|
||||
;
|
||||
};
|
||||
|
||||
_.extend(PromisesUserAjax.prototype, AbstractAjaxPromises.prototype);
|
||||
|
||||
module.exports = new PromisesUserAjax();
|
||||
|
||||
}());
|
||||
|
|
@ -393,6 +393,16 @@ html.rl-no-preview-pane {
|
|||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.threads-len {
|
||||
.threads-len-data {
|
||||
background-color: #999;
|
||||
color: #fff;
|
||||
border-radius: 6px;
|
||||
padding: 0px 4px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.subject-prefix {
|
||||
color: #888;
|
||||
/*font-style: italic;*/
|
||||
|
|
@ -437,6 +447,16 @@ html.rl-no-preview-pane {
|
|||
text-shadow: 0px 1px 0px #eee;
|
||||
}
|
||||
|
||||
&.hasUnseenSubMessage {
|
||||
background-color: #FFFFD9;
|
||||
.sidebarParent {
|
||||
background-color: lighten(orange, 30%);
|
||||
}
|
||||
&.focused .sidebarParent {
|
||||
background-color: darken(orange, 10%) !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.unseen {
|
||||
background-color: #FFFFD9;
|
||||
.sender, .subject, .subject-suffix {
|
||||
|
|
@ -451,16 +471,7 @@ html.rl-no-preview-pane {
|
|||
}
|
||||
}
|
||||
|
||||
&.hasUnseenSubMessage {
|
||||
background-color: #FFFFD9;
|
||||
.sidebarParent {
|
||||
background-color: lighten(orange, 30%);
|
||||
}
|
||||
&.focused .sidebarParent {
|
||||
background-color: darken(orange, 10%) !important;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
&.hasParentMessage {
|
||||
background-color: #ecf0f1;
|
||||
|
||||
|
|
@ -484,6 +495,7 @@ html.rl-no-preview-pane {
|
|||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
&.checked {
|
||||
.sidebarParent {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ html.rl-no-preview-pane {
|
|||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
left: -2px;
|
||||
height: 30px;
|
||||
padding: 10px 0;
|
||||
color: #fff;
|
||||
|
|
@ -365,15 +365,24 @@ html.rl-no-preview-pane {
|
|||
border-color: darken(@rlMainDarkColor, 5%);
|
||||
}
|
||||
|
||||
.thread-controls {
|
||||
.dropdown-toggle {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
&.open .dropdown-toggle {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.thread-list {
|
||||
|
||||
.e-link {
|
||||
padding: 3px 5px 3px 10px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding: 3px 8px 3px 10px;
|
||||
}
|
||||
|
||||
.hread-date {
|
||||
.thread-date {
|
||||
font-size: 13px;
|
||||
color: #999;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
text-shadow: 0 1px 0 #000;
|
||||
|
||||
display: inline-block;
|
||||
height: 28px;
|
||||
height: 29px;
|
||||
max-width: 250px;
|
||||
border-radius: 4px;
|
||||
font-size: 16px;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ select {
|
|||
}
|
||||
|
||||
.btn {
|
||||
border-radiu: @btnBorderRadius;
|
||||
border-radius: @btnBorderRadius;
|
||||
background-image: none;
|
||||
padding-left: 13px;
|
||||
padding-right: 13px;
|
||||
|
|
@ -180,26 +180,22 @@ html.rgba.textshadow {
|
|||
}
|
||||
}
|
||||
|
||||
// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
|
||||
.btn-group > .btn:first-child {
|
||||
border-top-left-radius: @btnBorderRadius;
|
||||
border-bottom-left-radius: @btnBorderRadius;
|
||||
.btn-group > .btn {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
|
||||
.btn-group > .btn:last-child,
|
||||
.btn-group > .dropdown-toggle {
|
||||
border-top-right-radius: @btnBorderRadius;
|
||||
border-bottom-right-radius: @btnBorderRadius;
|
||||
|
||||
.btn-group > .btn.single {
|
||||
border-radius: @btnBorderRadius !important;
|
||||
}
|
||||
// Reset corners for large buttons
|
||||
.btn-group > .btn.large:first-child {
|
||||
border-top-left-radius: @btnBorderRadius;
|
||||
border-bottom-left-radius: @btnBorderRadius;
|
||||
|
||||
.btn-group > .btn.first {
|
||||
border-top-left-radius: @btnBorderRadius !important;
|
||||
border-bottom-left-radius: @btnBorderRadius !important;
|
||||
}
|
||||
.btn-group > .btn.large:last-child,
|
||||
.btn-group > .large.dropdown-toggle {
|
||||
border-top-right-radius: @btnBorderRadius;
|
||||
border-bottom-right-radius: @btnBorderRadius;
|
||||
|
||||
.btn-group > .btn.last {
|
||||
border-top-right-radius: @btnBorderRadius !important;
|
||||
border-bottom-right-radius: @btnBorderRadius !important;
|
||||
}
|
||||
|
||||
.dropdown.colored-toggle.open .btn.dropdown-toggle {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
|
||||
this.fullScreenMode = MessageStore.messageFullScreenMode;
|
||||
|
||||
this.messageListOfThreadsLoading = Promises.messageListSimple.loading;
|
||||
this.messageListOfThreadsLoading = ko.observable(false).extend({'rateLimit': 1});
|
||||
|
||||
this.lastReplyAction_ = ko.observable('');
|
||||
this.lastReplyAction = ko.computed({
|
||||
|
|
@ -308,12 +308,13 @@
|
|||
if (aStatus && aStatus[0])
|
||||
{
|
||||
self.viewThreadMessages([]);
|
||||
Promises.messageListSimple(sFolder, aUids).then(function (aList) {
|
||||
|
||||
Promises.messageListSimple(sFolder, aUids, this.messageListOfThreadsLoading).then(function (aList) {
|
||||
|
||||
_.each(aList, function (oItem) {
|
||||
if (oItem && oItem.uid)
|
||||
{
|
||||
oItem.selected(sUid === oItem.uid);
|
||||
oItem.selected = sUid === oItem.uid;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -322,7 +323,7 @@
|
|||
}, function (iErrorCode) {
|
||||
|
||||
window.alert(Translator.getNotification(iErrorCode));
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -577,18 +578,21 @@
|
|||
kn.showScreenPopup(require('View/Popup/Compose'), [sType, MessageStore.message()]);
|
||||
};
|
||||
|
||||
MessageViewMailBoxUserView.prototype.checkHeaderHeight = function ()
|
||||
{
|
||||
if (this.oHeaderDom)
|
||||
{
|
||||
this.viewBodyTopValue(this.message() ? this.oHeaderDom.height() +
|
||||
20 /* padding-(top/bottom): 20px */ + 1 /* borded-bottom: 1px */ : 0);
|
||||
}
|
||||
};
|
||||
|
||||
MessageViewMailBoxUserView.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
sErrorMessage = Translator.i18n('PREVIEW_POPUP/IMAGE_ERROR'),
|
||||
fCheckHeaderHeight = function () {
|
||||
if (self.oHeaderDom)
|
||||
{
|
||||
self.viewBodyTopValue(self.message() ? self.oHeaderDom.height() +
|
||||
20 /* padding-(top/bottom): 20px */ + 1 /* borded-bottom: 1px */ : 0);
|
||||
}
|
||||
}
|
||||
fCheckHeaderHeight = _.bind(this.checkHeaderHeight, this)
|
||||
;
|
||||
|
||||
this.fullScreenMode.subscribe(function (bValue) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue