Fixed strange characters in plain text mode (Firefox) (Closes #462)

This commit is contained in:
RainLoop Team 2015-02-17 16:04:03 +04:00
parent 2a90664574
commit e3064b10aa
24 changed files with 206 additions and 159 deletions

View file

@ -1151,7 +1151,6 @@
AppUser.prototype.setFolders = function (oData)
{
var
aList = [],
bUpdate = false,
fNormalizeFolder = function (sFolderFullNameRaw) {
return ('' === sFolderFullNameRaw || Consts.Values.UnuseOptionValue === sFolderFullNameRaw ||
@ -1170,8 +1169,7 @@
AppStore.threadsAllowed(!!Settings.settingsGet('UseImapThread') &&
oData.Result.IsThreadsSupported && true);
aList = this.folderResponseParseRec(Data.namespace, oData.Result['@Collection']);
Data.folderList(aList);
Data.folderList(this.folderResponseParseRec(Data.namespace, oData.Result['@Collection']));
if (oData.Result['SystemFolders'] && '' === '' +
Settings.settingsGet('SentFolder') +

View file

@ -101,7 +101,7 @@
*/
HtmlEditor.prototype.clearSignatureSigns = function (sText)
{
return sText.replace(/(\u0002|\u0003|\u0004|\u0005)/g, '');
return sText.replace(/(\u0002|\u0003|\u200C|\u200D)/g, '');
};
/**

View file

@ -351,7 +351,6 @@
key('up, shift+up, down, shift+down, home, end, pageup, pagedown, insert, space', sKeyScope, function (event, handler) {
if (event && handler && handler.shortcut)
{
// TODO
var iKey = 0;
switch (handler.shortcut)
{

View file

@ -1009,6 +1009,10 @@
;
sText = sHtml
// specials for signature
.replace(/\u0002\u0002/g, '\u200C\u200C')
.replace(/\u0003\u0003/g, '\u200D\u200D')
.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gmi, convertPre)
.replace(/[\s]+/gm, ' ')
.replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue)
@ -1154,6 +1158,11 @@
sPlain = aText.join("\n");
sPlain = sPlain
// specials for signature
.replace(/\u200C\u200C/g, '\u0002\u0002')
.replace(/\u200D\u200D/g, '\u0003\u0003')
// .replace(/~~~\/blockquote~~~\n~~~blockquote~~~/g, '\n')
.replace(/&/g, '&amp;')
.replace(/>/g, '&gt;').replace(/</g, '&lt;')
@ -1693,6 +1702,20 @@
}
};
Utils.substr = window.String.substr;
if ('ab'.substr(-1) !== 'b')
{
Utils.substr = function(sStr, iStart, iLength)
{
if (iStart < 0)
{
iStart = sStr.length + iStart;
}
return sStr.substr(iStart, iLength);
};
}
module.exports = Utils;
}());

View file

@ -75,6 +75,10 @@
{
var sInboxFolderName = Cache.getFolderInboxName();
this.isInbox = ko.computed(function () {
return Enums.FolderType.Inbox === this.type();
}, this);
this.hasSubScribedSubfolders = ko.computed(function () {
return !!_.find(this.subFolders(), function (oFolder) {
return oFolder.subScribed() && !oFolder.isSystemFolder();

View file

@ -4,7 +4,6 @@
'use strict';
var
window = require('window'),
_ = require('_'),
ko = require('ko'),
@ -21,37 +20,13 @@
{
this.domains = DomainStore.domains;
this.iDomainForDeletionTimeout = 0;
this.visibility = ko.computed(function () {
return this.domains.loading() ? 'visible' : 'hidden';
}, this);
this.domainForDeletion = ko.observable(null).extend({'toggleSubscribe': [this,
function (oPrev) {
if (oPrev)
{
oPrev.deleteAccess(false);
}
}, function (oNext) {
if (oNext)
{
oNext.deleteAccess(true);
this.startDomainForDeletionTimeout();
}
}
]});
this.domainForDeletion = ko.observable(null).deleteAccessHelper();
}
DomainsAdminSettings.prototype.startDomainForDeletionTimeout = function ()
{
var self = this;
window.clearInterval(this.iDomainForDeletionTimeout);
this.iDomainForDeletionTimeout = window.setTimeout(function () {
self.domainForDeletion(null);
}, 1000 * 3);
};
DomainsAdminSettings.prototype.createDomain = function ()
{
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Domain'));

View file

@ -31,11 +31,8 @@
this.serverErrorDesc = ko.observable('');
this.haveChanges = ko.observable(false);
this.processText = ko.observable('');
this.saveErrorText = ko.observable('');
this.visibility = ko.observable(false);
this.filters.subscribe(Utils.windowResizeCallback);
this.serverError.subscribe(function (bValue) {
@ -51,14 +48,6 @@
this.filterRaw.allow = ko.observable(false);
this.filterRaw.error = ko.observable(false);
this.processText = ko.computed(function () {
return this.filters.loading() ? Translator.i18n('SETTINGS_FILTERS/LOADING_PROCESS') : '';
}, this);
this.visibility = ko.computed(function () {
return '' === this.processText() ? 'hidden' : 'visible';
}, this);
this.filterForDeletion = ko.observable(null).extend({'falseTimeout': 3000}).extend(
{'toggleSubscribeProperty': [this, 'deleteAccess']});

View file

@ -24,7 +24,7 @@
{
this.folderList = Data.folderList;
this.processText = ko.computed(function () {
this.loading = ko.computed(function () {
var
bLoading = Data.foldersLoading(),
@ -33,44 +33,11 @@
bRenaming = Data.foldersRenaming()
;
if (bCreating)
{
return Translator.i18n('SETTINGS_FOLDERS/CREATING_PROCESS');
}
else if (bDeleting)
{
return Translator.i18n('SETTINGS_FOLDERS/DELETING_PROCESS');
}
else if (bRenaming)
{
return Translator.i18n('SETTINGS_FOLDERS/RENAMING_PROCESS');
}
else if (bLoading)
{
return Translator.i18n('SETTINGS_FOLDERS/LOADING_PROCESS');
}
return '';
return bLoading || bCreating || bDeleting || bRenaming;
}, this);
this.visibility = ko.computed(function () {
return '' === this.processText() ? 'hidden' : 'visible';
}, this);
this.folderForDeletion = ko.observable(null).extend({'falseTimeout': 3000}).extend({'toggleSubscribe': [this,
function (oPrev) {
if (oPrev)
{
oPrev.deleteAccess(false);
}
}, function (oNext) {
if (oNext)
{
oNext.deleteAccess(true);
}
}
]});
this.folderForDeletion = ko.observable(null).deleteAccessHelper();
this.folderForEdit = ko.observable(null).extend({'toggleSubscribe': [this,
function (oPrev) {

View file

@ -23,19 +23,7 @@
this.openpgpkeysPublic = PgpStore.openpgpkeysPublic;
this.openpgpkeysPrivate = PgpStore.openpgpkeysPrivate;
this.openPgpKeyForDeletion = ko.observable(null).extend({'falseTimeout': 3000}).extend({'toggleSubscribe': [this,
function (oPrev) {
if (oPrev)
{
oPrev.deleteAccess(false);
}
}, function (oNext) {
if (oNext)
{
oNext.deleteAccess(true);
}
}
]});
this.openPgpKeyForDeletion = ko.observable(null).deleteAccessHelper();
}
OpenPgpUserSettings.prototype.addOpenPgpKey = function ()

View file

@ -64,6 +64,13 @@
this.foldersDeleting = ko.observable(false);
this.foldersRenaming = ko.observable(false);
this.foldersListWithSingleInboxRootFolder = ko.computed(function () {
var aList = this.folderList();
return !_.find(aList, function (oFolder) {
return oFolder && !oFolder.isSystemFolder() && oFolder.visible();
});
}, this);
this.foldersChanging = ko.computed(function () {
var
bLoading = this.foldersLoading(),

View file

@ -165,6 +165,14 @@
.b-sub-folders.unpaddig-folder .b-sub-folders .b-sub-folders .b-sub-folders .e-item .e-link {
padding-left: @subPadding * 3 + @folderItemPadding;
}
&.single-root-inbox .i-am-inbox.e-link {
display: none;
}
&.single-root-inbox .i-am-inbox-wrapper > .b-sub-folders .e-item .e-link {
padding-left: @folderItemPadding;
}
}
html.rl-left-panel-disabled {

View file

@ -73,6 +73,10 @@ select {
line-height: 11px;
}
.btn.btn-thin {
padding: 3px 9px;
}
.btn.btn-ellipsis {
text-overflow: ellipsis;
overflow: hidden;

View file

@ -116,7 +116,6 @@
if (this.editor)
{
this.editor.setPlain('', false);
this.editor.setReadOnly(true);
}
};

View file

@ -43,6 +43,8 @@
this.folderListSystem = Data.folderListSystem;
this.foldersChanging = Data.foldersChanging;
this.foldersListWithSingleInboxRootFolder = Data.foldersListWithSingleInboxRootFolder;
this.leftPanelDisabled = Globals.leftPanelDisabled;
this.iDropOverTimer = 0;