Improvements of message displaying (internal styles)

This commit is contained in:
RainLoop Team 2015-05-31 21:40:54 +04:00
parent 0bba7146a6
commit 4457cdbc23
46 changed files with 1967 additions and 359 deletions

View file

@ -1511,7 +1511,7 @@
self.initVerticalLayoutResizer(Enums.ClientSideKeyName.FolderListSize);
});
if (Tinycon)
if (Tinycon && !Settings.settingsGet('Filtered'))
{
Tinycon.setOptions({
fallback: false

View file

@ -196,7 +196,7 @@
{
this.modeToggle(true);
sHtml = sHtml.replace(/<[pP][^>]*><\/[pP]>/g, '');
sHtml = sHtml.replace(/<p[^>]*><\/p>/ig, '');
try {
this.editor.setData(sHtml);

View file

@ -867,13 +867,16 @@
sText = sHtml
.replace(/\u0002([\s\S]*)\u0002/gm, '\u200C$1\u200C')
.replace(/<[pP][^>]*><\/[pP]>/g, '')
.replace(/<p[^>]*><\/p>/gi, '')
.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gmi, convertPre)
.replace(/[\s]+/gm, ' ')
.replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue)
.replace(/<br[^>]*>/gmi, '\n')
.replace(/<\/h[\d]>/gi, '\n')
.replace(/<\/p>/gi, '\n\n')
.replace(/<ul[^>]*>/gmi, '\n')
.replace(/<\/ul>/gi, '\n')
.replace(/<li[^>]*>/gmi, ' * ')
.replace(/<\/li>/gi, '\n')
.replace(/<\/td>/gi, '\n')
.replace(/<\/tr>/gi, '\n')

View file

@ -55,6 +55,11 @@
nFoldersInboxUnreadCount = FolderStore.foldersInboxUnreadCount()
;
if (Settings.settingsGet('Filtered'))
{
nFoldersInboxUnreadCount = 0;
}
require('App/User').setWindowTitle(('' === sEmail ? '' : '' +
(0 < nFoldersInboxUnreadCount ? '(' + nFoldersInboxUnreadCount + ') ' : ' ') +
sEmail + ' - ') + Translator.i18n('TITLES/MAILBOX'));
@ -82,7 +87,6 @@
* @param {string} sFolderHash
* @param {number} iPage
* @param {string} sSearch
* @param {boolean=} bPreview = false
*/
MailBoxUserScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch)
{

View file

@ -20,6 +20,7 @@
this.googleEnable = SocialStore.google.enabled;
this.googleEnableAuth = SocialStore.google.capa.auth;
this.googleEnableAuthFast = SocialStore.google.capa.authFast;
this.googleEnableDrive = SocialStore.google.capa.drive;
this.googleEnablePreview = SocialStore.google.capa.preview;

View file

@ -15,6 +15,7 @@
this.googleEnable = SocialStore.google.enabled;
this.googleEnableAuth = SocialStore.google.capa.auth;
this.googleEnableAuthFast = SocialStore.google.capa.authFast;
this.googleEnableDrive = SocialStore.google.capa.drive;
this.googleEnablePreview = SocialStore.google.capa.preview;

View file

@ -33,6 +33,7 @@
this.google.capa = {};
this.google.capa.auth = ko.observable(false);
this.google.capa.authFast = ko.observable(false);
this.google.capa.drive = ko.observable(false);
this.google.capa.preview = ko.observable(false);
@ -88,6 +89,7 @@
this.google.apiKey(Settings.settingsGet('GoogleApiKey'));
this.google.capa.auth(!!Settings.settingsGet('AllowGoogleSocialAuth'));
this.google.capa.authFast(!!Settings.settingsGet('AllowGoogleSocialAuthFast'));
this.google.capa.drive(!!Settings.settingsGet('AllowGoogleSocialDrive'));
this.google.capa.preview(!!Settings.settingsGet('AllowGoogleSocialPreview'));

View file

@ -25,6 +25,9 @@
max-width: 450px;
}
.wrapper-parent {
}
.loginForm {
background-color: #efefef;
text-align: left;
@ -34,6 +37,18 @@
width: 303px;
}
.loginWelcomeForm {
display: none;
}
.welcome-on {
display: block;
}
.welcome-off {
display: none;
}
/* .control-label {
font-size: 16px;
line-height: 30px;

View file

@ -331,6 +331,10 @@ html.rl-no-preview-pane {
}
}
.bodySubHeader {
z-index: 2;
}
.bodyText {
color: #000;
@ -338,9 +342,11 @@ html.rl-no-preview-pane {
.b-text-part {
height: 100%;
div[data-x-div-type=html] {
height: 100%;
div[data-x-div-type=html] {
div[data-x-div-type=body] {
height: 100%;
}
}
@ -357,14 +363,10 @@ html.rl-no-preview-pane {
}
}
table {
border-collapse: separate;
}
blockquote {
border-left: 2px solid #000;
margin: 0;
padding: 0px 10px;
margin: 0;
}
.rl-bq-switcher.hidden-bq {
@ -372,8 +374,10 @@ html.rl-no-preview-pane {
}
&.html {
div[data-x-div-type=body] {
margin: 15px;
padding: 15px;
// margin: 15px;
}
pre {

View file

@ -33,6 +33,10 @@
min-height: 300px;
}
.g-ui-100-proc-height {
height: 100%;
}
.g-ui-absolute-reset {
position: absolute;
top: 0;

View file

@ -17,12 +17,19 @@
width: 17px;
}
.iconsize50 {
line-height: 50px;
font-size: 50px;
width: 50px;
height: 50px;
}
.iconsize24 {
line-height: 24px;
font-size: 24px;
}
.iconsize24 {
.iconsize20 {
line-height: 20px;
font-size: 20px;
}

View file

@ -36,6 +36,8 @@
{
AbstractView.call(this, 'Center', 'Login');
this.welcome = ko.observable(!!Settings.settingsGet('UseLoginWelcomePage'));
this.email = ko.observable('');
this.password = ko.observable('');
this.signMe = ko.observable(false);
@ -294,11 +296,12 @@
});
this.googleLoginEnabled = ko.observable(false);
this.googleFastLoginEnabled = ko.observable(false);
this.googleCommand = Utils.createCommand(this, function () {
window.open(Links.socialGoogle(), 'Google',
'left=200,top=100,width=650,height=450,menubar=no,status=no,resizable=yes,scrollbars=yes');
'left=200,top=100,width=650,height=500,menubar=no,status=no,resizable=yes,scrollbars=yes');
return true;
@ -306,15 +309,15 @@
return !this.submitRequest() && this.googleLoginEnabled();
});
this.googleXAuthCommand = Utils.createCommand(this, function () {
this.googleFastCommand = Utils.createCommand(this, function () {
window.open(Links.socialGoogle(true), 'Google',
'left=200,top=100,width=650,height=450,menubar=no,status=no,resizable=yes,scrollbars=yes');
'left=200,top=100,width=650,height=500,menubar=no,status=no,resizable=yes,scrollbars=yes');
return true;
}, function () {
return !this.submitRequest() && this.googleLoginEnabled();
return !this.submitRequest() && this.googleFastLoginEnabled();
});
this.twitterLoginEnabled = ko.observable(false);
@ -347,6 +350,11 @@
kn.extendAsViewModel(['View/User/Login', 'View/App/Login', 'LoginViewModel'], LoginUserView);
_.extend(LoginUserView.prototype, AbstractView.prototype);
LoginUserView.prototype.displayMainForm = function ()
{
this.welcome(false);
};
LoginUserView.prototype.onShow = function ()
{
kn.routeOff();
@ -404,6 +412,8 @@
this.twitterLoginEnabled(!!Settings.settingsGet('AllowTwitterSocial'));
this.googleLoginEnabled(!!Settings.settingsGet('AllowGoogleSocial') &&
!!Settings.settingsGet('AllowGoogleSocialAuth'));
this.googleFastLoginEnabled(!!Settings.settingsGet('AllowGoogleSocial') &&
!!Settings.settingsGet('AllowGoogleSocialAuthFast'));
switch (sSignMe)
{
@ -433,7 +443,7 @@
this.email(AppStore.devEmail);
this.password(AppStore.devPassword);
if (this.googleLoginEnabled())
if (this.googleLoginEnabled() || this.googleFastLoginEnabled())
{
window['rl_' + sJsHash + '_google_login_service'] = fSocial;
}

View file

@ -24,8 +24,6 @@
Cache = require('Common/Cache'),
EmailModel = require('Model/Email'),
SocialStore = require('Stores/Social'),
AppStore = require('Stores/User/App'),
SettingsStore = require('Stores/User/Settings'),
@ -66,6 +64,8 @@
this.oHeaderDom = null;
this.oMessageScrollerDom = null;
this.bodyBackgroundColor = ko.observable('');
this.pswp = null;
this.allowComposer = !!Settings.capa(Enums.Capa.Composer);
@ -353,6 +353,10 @@
}, this);
this.messageActiveDom.subscribe(function (oDom) {
this.bodyBackgroundColor(oDom ? this.detectDomBackgroundColor(oDom): '');
}, this);
this.message.subscribe(function (oMessage) {
this.messageActiveDom(null);
@ -466,6 +470,59 @@
kn.extendAsViewModel(['View/User/MailBox/MessageView', 'View/App/MailBox/MessageView', 'MailBoxMessageViewViewModel'], MessageViewMailBoxUserView);
_.extend(MessageViewMailBoxUserView.prototype, AbstractView.prototype);
MessageViewMailBoxUserView.prototype.detectDomBackgroundColor = function (oDom)
{
var
iLimit = 5,
sResult = '',
aC = null,
fFindDom = function (oDom) {
var aC = oDom ? oDom.children() : null;
return (aC && 1 === aC.length && aC.is('table,div,center')) ? aC : null;
},
fFindColor = function (oDom) {
var sResult = '';
if (oDom)
{
sResult = oDom.css('background-color') || '';
if (!oDom.is('table'))
{
sResult = 'rgba(0, 0, 0, 0)' === sResult || 'transparent' === sResult ? '' : sResult;
}
}
return sResult;
}
;
if (oDom && 1 === oDom.length)
{
aC = oDom;
while ('' === sResult)
{
iLimit--;
if (0 >= iLimit)
{
break;
}
aC = fFindDom(aC);
if (aC)
{
sResult = fFindColor(aC);
}
else
{
break;
}
}
sResult = 'rgba(0, 0, 0, 0)' === sResult || 'transparent' === sResult ? '' : sResult;
}
return sResult;
};
MessageViewMailBoxUserView.prototype.isPgpActionVisible = function ()
{
return Enums.SignedVerifyStatus.Success !== this.viewPgpSignedVerifyStatus();
@ -552,27 +609,28 @@
* @todo
* @param {string} sEmail
*/
MessageViewMailBoxUserView.prototype.displayMailToPopup = function (sMailToUrl)
{
sMailToUrl = sMailToUrl.replace(/\?.+$/, '');
var
sResult = '',
aTo = [],
fParseEmailLine = function (sLine) {
return sLine ? _.compact(_.map([window.decodeURIComponent(sLine)], function (sItem) {
var oEmailModel = new EmailModel();
oEmailModel.mailsoParse(sItem);
return '' !== oEmailModel.email ? oEmailModel : null;
})) : null;
}
;
aTo = fParseEmailLine(sMailToUrl);
sResult = aTo && aTo[0] ? aTo[0].email : '';
window.console.log(sResult);
};
// MessageViewMailBoxUserView.prototype.displayMailToPopup = function (sMailToUrl)
// {
// sMailToUrl = sMailToUrl.replace(/\?.+$/, '');
//
// var
// sResult = '',
// aTo = [],
// EmailModel = require('Model/Email'),
// fParseEmailLine = function (sLine) {
// return sLine ? _.compact(_.map([window.decodeURIComponent(sLine)], function (sItem) {
// var oEmailModel = new EmailModel();
// oEmailModel.mailsoParse(sItem);
// return '' !== oEmailModel.email ? oEmailModel : null;
// })) : null;
// }
// ;
//
// aTo = fParseEmailLine(sMailToUrl);
// sResult = aTo && aTo[0] ? aTo[0].email : '';
//
// return sResult;
// };
MessageViewMailBoxUserView.prototype.onBuild = function (oDom)
{
@ -592,6 +650,7 @@
}
}, this);
this.showAttachmnetControls.subscribe(fCheckHeaderHeight);
this.fullScreenMode.subscribe(fCheckHeaderHeight);
this.showFullInfo.subscribe(fCheckHeaderHeight);
this.message.subscribe(fCheckHeaderHeight);
@ -806,18 +865,6 @@
this.initShortcuts();
};
MessageViewMailBoxUserView.prototype.selectSelectedThreadMessage = function ()
{
var self = this;
_.delay(function () {
var oLast = self.oDom ? $('.thread-list .e-item.thread-list-message.real-msg.selected a.e-link', self.oDom) : null;
if (oLast && oLast[0])
{
oLast.focus();
}
}, 30);
};
/**
* @return {boolean}
*/
@ -1196,6 +1243,8 @@
{
oMessage.showExternalImages(true);
}
this.checkHeaderHeight();
};
/**
@ -1217,6 +1266,8 @@
{
oMessage.verifyPgpSignedClearMessage();
}
this.checkHeaderHeight();
};
/**
@ -1248,6 +1299,8 @@
require('App/User').reloadFlagsCurrentMessageListAndMessageFromCache();
}
this.checkHeaderHeight();
};
module.exports = MessageViewMailBoxUserView;