This commit is contained in:
RainLoop Team 2015-03-19 01:26:52 +04:00
parent d8c9f7ec14
commit 16d2f46a31
7 changed files with 51 additions and 38 deletions

View file

@ -47,6 +47,9 @@
this.attachmentsClass = '';
};
/**
* @return {string}
*/
MessageFullModel.prototype.getAttachmentsClass = function ()
{
var sClass = '';
@ -81,23 +84,25 @@
{
var bResult = false;
if (oJson && 'Object/Message' === oJson['@Object'] &&
MessageSimpleModel.prototype.initByJson.call(this, oJson))
if (oJson && 'Object/Message' === oJson['@Object'])
{
this.priority = Utils.pInt(oJson.Priority);
this.priority = Utils.inArray(this.priority, [Enums.MessagePriority.High, Enums.MessagePriority.Low]) ?
this.priority : Enums.MessagePriority.Normal;
if (MessageSimpleModel.prototype.initByJson.call(this, oJson))
{
this.priority = Utils.pInt(oJson.Priority);
this.priority = Utils.inArray(this.priority, [Enums.MessagePriority.High, Enums.MessagePriority.Low]) ?
this.priority : Enums.MessagePriority.Normal;
this.hash = Utils.pString(oJson.Hash);
this.requestHash = Utils.pString(oJson.RequestHash);
this.hash = Utils.pString(oJson.Hash);
this.requestHash = Utils.pString(oJson.RequestHash);
this.proxy = !!oJson.ExternalProxy;
this.proxy = !!oJson.ExternalProxy;
this.hasAttachments = !!oJson.HasAttachments;
this.attachmentsMainType = Utils.pString(oJson.AttachmentsMainType);
this.attachmentsClass = this.getAttachmentsClass();
this.hasAttachments = !!oJson.HasAttachments;
this.attachmentsMainType = Utils.pString(oJson.AttachmentsMainType);
this.attachmentsClass = this.getAttachmentsClass();
bResult = true;
bResult = true;
}
}
return bResult;

View file

@ -7,20 +7,20 @@
_ = require('_'),
ko = require('ko'),
Enums = require('Common/Enums'),
Utils = require('Common/Utils'),
// Enums = require('Common/Enums'),
// Utils = require('Common/Utils'),
//
// MessageHelper = require('Helper/Message'),
MessageHelper = require('Helper/Message'),
MessageSimpleModel = require('Model/MessageSimple')
AbstractModel = require('Knoin/AbstractModel')
;
/**
* @constructor
*/
function MessageDynamicModel()
function MessageStatesModel()
{
MessageSimpleModel.call(this, 'MessageDynamicModel');
AbstractModel.call(this, 'MessageStatesModel');
this.flags = {};
this.states = {};
@ -39,15 +39,18 @@
this.states.showReadReceipt = ko.observable(false);
this.states.showExternalImages = ko.observable(false);
this.states.hasUnseenSubMessage = ko.observable(false);
this.states.hasFlaggedSubMessage = ko.observable(false);
this.states.hasUnseenSubMessages = ko.observable(false);
this.states.hasFlaggedSubMessages = ko.observable(false);
this.threads = ko.observableArray([]);
}
_.extend(MessageDynamicModel.prototype, MessageSimpleModel.prototype);
_.extend(MessageStatesModel.prototype, AbstractModel.prototype);
MessageDynamicModel.prototype.clear = function ()
MessageStatesModel.prototype.flags = {};
MessageStatesModel.prototype.states = {};
MessageStatesModel.prototype.clear = function ()
{
this.flags.unseen(false);
this.flags.deleted(false);
@ -58,6 +61,6 @@
this.threads([]);
};
module.exports = MessageDynamicModel;
module.exports = MessageStatesModel;
}());

View file

@ -182,19 +182,23 @@
.b-attachment-place {
position: absolute;
height: 120px;
left: 5px;
right: 5px;
top: 5px;
bottom: 5px;
border: 2px #777 dashed;
z-index: 300;
line-height: 119px;
text-align: center;
background-color: #fff;
z-index: 300;
left: 20px;
right: 20px;
background-color: #efefef;
font-size: 24px;
&.drag-and-drop-over {
background: #777;
color: #fff;
border-radius: 10px;
&.dragAndDropOver {
background-color: #fff;
}
}
}

View file

@ -1609,6 +1609,7 @@
this.dragAndDropOver(false);
}, this))
.on('onBodyDragEnter', _.bind(function () {
this.attachmentsPlace(true);
this.dragAndDropVisible(true);
}, this))
.on('onBodyDragLeave', _.bind(function () {

View file

@ -2,7 +2,7 @@
"name": "RainLoop",
"title": "RainLoop Webmail",
"version": "1.8.2",
"release": "289",
"release": "290",
"description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net",
"main": "gulpfile.js",

View file

@ -1527,8 +1527,8 @@ class Actions
$aResult['AllowDropboxSocial'] = (bool) $oConfig->Get('social', 'dropbox_enable', false);
$aResult['DropboxApiKey'] = (string) $oConfig->Get('social', 'dropbox_api_key', '');
$aResult['SubscriptionEnabled'] = \MailSo\Base\Utils::ValidateDomain($aResult['AdminDomain']) ||
\MailSo\Base\Utils::ValidateIP($aResult['AdminDomain']);
$aResult['SubscriptionEnabled'] = \MailSo\Base\Utils::ValidateDomain($aResult['AdminDomain']);
// || \MailSo\Base\Utils::ValidateIP($aResult['AdminDomain']);
$aResult['WeakPassword'] = $oConfig->ValidatePassword('12345');
$aResult['CoreAccess'] = $this->rainLoopCoreAccess();

View file

@ -155,9 +155,6 @@
<div class="e-cell e-label"></div>
<div class="e-cell e-value">
<div>
<div class="b-attachment-place" data-bind="visible: addAttachmentEnabled() && dragAndDropEnabled() && dragAndDropVisible(), initDom: composeUploaderDropPlace, css: {'dragAndDropOver': dragAndDropOver}">
<span class="i18n" data-i18n-text="COMPOSE/ATTACH_DROP_FILES_DESC"></span>
</div>
<div class="pull-left">
<div class="btn-group" data-toggle="buttons-radio">
<button type="button" class="btn first" data-bind="click: function () { attachmentsPlace(false); },
@ -205,6 +202,9 @@
<div class="attachmentAreaParent b-content" style="height: 200px; min-height: 200px" data-bind="nano: true, visible: attachmentsPlace, initResizeTrigger: [resizer(), 200, 57]">
<div class="content g-scrollbox">
<div class="content-wrapper">
<div class="b-attachment-place" data-bind="visible: addAttachmentEnabled() && dragAndDropEnabled() && dragAndDropVisible(), initDom: composeUploaderDropPlace, css: {'dragAndDropOver': dragAndDropOver}">
<span class="i18n" data-i18n-text="COMPOSE/ATTACH_DROP_FILES_DESC"></span>
</div>
<ul class="attachmentList" data-bind="template: { name: 'ComposeAttachment', foreach: attachments }"></ul>
<div class="no-attachments-desc" data-bind="visible: 0 === attachments().length">
<span class="i18n" data-i18n-text="COMPOSE/NO_ATTACHMENTS_HERE_DESC"></span>