mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Updated: ckeditor 4.5.3, jquery 1.11.3, openpgpjs 1.2.0
OpenPGP decrypt fix + Small fixes
This commit is contained in:
parent
4deb083d7d
commit
87887373c1
370 changed files with 10805 additions and 5637 deletions
2
vendors/ckeditor-plugins/plain/plugin.js
vendored
2
vendors/ckeditor-plugins/plain/plugin.js
vendored
|
|
@ -86,6 +86,8 @@
|
|||
textarea.setAttribute('dir', 'ltr');
|
||||
textarea.addClass('cke_plain');
|
||||
|
||||
CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(textarea);
|
||||
|
||||
contentsSpace.append(textarea);
|
||||
|
||||
var editable = editor.editable(new plainEditable(editor, textarea));
|
||||
|
|
|
|||
193
vendors/ckeditor-plugins/signature/plugin.js
vendored
193
vendors/ckeditor-plugins/signature/plugin.js
vendored
|
|
@ -1,116 +1,121 @@
|
|||
|
||||
rl_signature_replacer = function (editor, sText, sSignature, bHtml, bInsertBefore)
|
||||
{
|
||||
if (!bHtml)
|
||||
(function (CKEDITOR, $, undefined) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var rl_signature_replacer = function (editor, sText, sSignature, bHtml, bInsertBefore)
|
||||
{
|
||||
sText = sText
|
||||
.replace(/\u200C([\s\S]*)\u200C/g, '\u0002$1\u0002')
|
||||
.replace(/\u200C/g, '')
|
||||
if (!bHtml)
|
||||
{
|
||||
sText = sText
|
||||
.replace(/\u200C([\s\S]*)\u200C/g, '\u0002$1\u0002')
|
||||
.replace(/\u200C/g, '')
|
||||
;
|
||||
}
|
||||
|
||||
var
|
||||
sP = '~~~~@~~~~',
|
||||
bEmptyText = false,
|
||||
sNewLine = (bHtml ? '<br />' : "\n")
|
||||
;
|
||||
}
|
||||
|
||||
var
|
||||
sP = '~~~~@~~~~',
|
||||
bEmptyText = false,
|
||||
sNewLine = (bHtml ? '<br />' : "\n")
|
||||
;
|
||||
sText = sText.replace(/\u0002([\s\S]*)\u0002/gm, sP + '$1' + sP);
|
||||
|
||||
sText = sText.replace(/\u0002([\s\S]*)\u0002/gm, sP + '$1' + sP);
|
||||
if (editor.__previos_signature)
|
||||
{
|
||||
sText = sText
|
||||
.replace(sP + editor.__previos_signature + sP, '')
|
||||
.replace(sP + editor.__previos_signature + sP, '')
|
||||
.replace(sP + editor.__previos_signature + sP, '')
|
||||
;
|
||||
}
|
||||
|
||||
if (editor.__previos_signature)
|
||||
{
|
||||
sText = sText
|
||||
.replace(sP + editor.__previos_signature + sP, '')
|
||||
.replace(sP + editor.__previos_signature + sP, '')
|
||||
.replace(sP + editor.__previos_signature + sP, '')
|
||||
;
|
||||
}
|
||||
sText = sText.replace(sP, '').replace(sP, '').replace(sP, '').replace(sP, '');
|
||||
|
||||
sText = sText.replace(sP, '').replace(sP, '').replace(sP, '').replace(sP, '');
|
||||
bEmptyText = '' === $.trim(sText);
|
||||
if (!bEmptyText && bHtml)
|
||||
{
|
||||
bEmptyText = '' !== $.trim(editor.__plainUtils.htmlToPlain(sText));
|
||||
}
|
||||
|
||||
bEmptyText = '' === $.trim(sText);
|
||||
if (!bEmptyText && bHtml)
|
||||
{
|
||||
bEmptyText = '' !== $.trim(editor.__plainUtils.htmlToPlain(sText));
|
||||
}
|
||||
if (bInsertBefore)
|
||||
{
|
||||
sText = "\u0002" + sSignature + (bEmptyText ? '' : sNewLine) + "\u0002" + sText;
|
||||
editor.__previos_signature = sSignature + (bEmptyText ? '' : sNewLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
sText = sText + "\u0002" + (bEmptyText ? '' : sNewLine) + sSignature + "\u0002";
|
||||
editor.__previos_signature = (bEmptyText ? '' : sNewLine) + sSignature;
|
||||
}
|
||||
|
||||
if (bInsertBefore)
|
||||
{
|
||||
sText = "\u0002" + sSignature + (bEmptyText ? '' : sNewLine) + "\u0002" + sText;
|
||||
editor.__previos_signature = sSignature + (bEmptyText ? '' : sNewLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
sText = sText + "\u0002" + (bEmptyText ? '' : sNewLine) + sSignature + "\u0002";
|
||||
editor.__previos_signature = (bEmptyText ? '' : sNewLine) + sSignature;
|
||||
}
|
||||
if (!bHtml)
|
||||
{
|
||||
sText = sText
|
||||
.replace(/\u0002([\s\S]*)\u0002/g, '\u200C$1\u200C')
|
||||
.replace(/\u0002/g, '')
|
||||
;
|
||||
}
|
||||
|
||||
if (!bHtml)
|
||||
{
|
||||
sText = sText
|
||||
.replace(/\u0002([\s\S]*)\u0002/g, '\u200C$1\u200C')
|
||||
.replace(/\u0002/g, '')
|
||||
;
|
||||
}
|
||||
return sText;
|
||||
};
|
||||
|
||||
return sText;
|
||||
};
|
||||
|
||||
CKEDITOR.plugins.add('signature', {
|
||||
init: function(editor) {
|
||||
editor.addCommand('insertSignature', {
|
||||
modes: { wysiwyg: 1, plain: 1 },
|
||||
exec: function (editor, cfg)
|
||||
{
|
||||
|
||||
var
|
||||
bIsHtml = false,
|
||||
bInsertBefore = false,
|
||||
sSignature = '',
|
||||
sResultSignature = ''
|
||||
;
|
||||
|
||||
if (cfg)
|
||||
CKEDITOR.plugins.add('signature', {
|
||||
init: function(editor) {
|
||||
editor.addCommand('insertSignature', {
|
||||
modes: { wysiwyg: 1, plain: 1 },
|
||||
exec: function (editor, cfg)
|
||||
{
|
||||
bIsHtml = undefined === cfg.isHtml ? false : !!cfg.isHtml;
|
||||
bInsertBefore = undefined === cfg.insertBefore ? false : !!cfg.insertBefore;
|
||||
sSignature = undefined === cfg.signature ? '' : cfg.signature;
|
||||
}
|
||||
var
|
||||
bIsHtml = false,
|
||||
bInsertBefore = false,
|
||||
sSignature = '',
|
||||
sResultSignature = ''
|
||||
;
|
||||
|
||||
sResultSignature = sSignature;
|
||||
|
||||
try
|
||||
{
|
||||
if ('plain' === editor.mode && editor.__plain && editor.__plainUtils)
|
||||
if (cfg)
|
||||
{
|
||||
if (editor.__plainUtils && editor.__plainUtils.htmlToPlain)
|
||||
{
|
||||
if (bIsHtml)
|
||||
{
|
||||
sResultSignature = editor.__plainUtils.htmlToPlain(sResultSignature);
|
||||
}
|
||||
}
|
||||
|
||||
editor.__plain.setRawData(
|
||||
rl_signature_replacer(editor, editor.__plain.getRawData(), sResultSignature, false, bInsertBefore));
|
||||
|
||||
bIsHtml = undefined === cfg.isHtml ? false : !!cfg.isHtml;
|
||||
bInsertBefore = undefined === cfg.insertBefore ? false : !!cfg.insertBefore;
|
||||
sSignature = undefined === cfg.signature ? '' : cfg.signature;
|
||||
}
|
||||
else
|
||||
|
||||
sResultSignature = sSignature;
|
||||
|
||||
try
|
||||
{
|
||||
if (editor.__plainUtils && editor.__plainUtils.plainToHtml)
|
||||
if ('plain' === editor.mode && editor.__plain && editor.__plainUtils)
|
||||
{
|
||||
if (!bIsHtml)
|
||||
if (editor.__plainUtils && editor.__plainUtils.htmlToPlain)
|
||||
{
|
||||
sResultSignature = editor.__plainUtils.plainToHtml(sResultSignature);
|
||||
if (bIsHtml)
|
||||
{
|
||||
sResultSignature = editor.__plainUtils.htmlToPlain(sResultSignature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
editor.setData(
|
||||
rl_signature_replacer(editor, editor.getData(), sResultSignature, true, bInsertBefore));
|
||||
editor.__plain.setRawData(
|
||||
rl_signature_replacer(editor, editor.__plain.getRawData(), sResultSignature, false, bInsertBefore));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (editor.__plainUtils && editor.__plainUtils.plainToHtml)
|
||||
{
|
||||
if (!bIsHtml)
|
||||
{
|
||||
sResultSignature = editor.__plainUtils.plainToHtml(sResultSignature);
|
||||
}
|
||||
}
|
||||
|
||||
editor.setData(
|
||||
rl_signature_replacer(editor, editor.getData(), sResultSignature, true, bInsertBefore));
|
||||
}
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}(CKEDITOR, $));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue