Commit Graph

51 Commits

Author SHA1 Message Date
Milan Crha 4cf2e9bd57 Composer: Correct conversion of TABLE into Plain Text
The <TR> is similar to <BR> for the Plain text, thus when reading it
add the new line, if needed.

The WebKit returns correct `\n` in the node's innerText, but using it
as a plain text hides it for the user, thus split the lines and add
them as separate paragraphs.
2022-10-21 10:30:18 +02:00
Milan Crha 3f530ba014 Composer: Some parts of HTML not always converted into Plain Text
When traversing the HTML structure the to-be-removed nodes in the middle
of the text could prevent correct move between nodes, by traversing into
them and immediately removing the node.
2022-07-11 17:44:08 +02:00
Milan Crha 1ee1bbe2a4 I#1923 - Composer: Add "Copy/Open Link" into the context menu
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1923
2022-06-13 14:10:32 +02:00
Milan Crha 51daf69daf I#1918 - Composer: Skip STYLE and other tags in convert to Plain Text
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1918
2022-05-30 14:06:24 +02:00
Milan Crha c7009fda1b I#1871 - WebKitEditor: Convert to plain text incorrect on reply/forward open
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1871
2022-04-28 18:52:38 +02:00
Milan Crha faa22c3bb4 I#1824 - Composer: Preserve STYLE element of the signature
And drop TITLE, if it exists.

Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1824
2022-03-03 11:06:00 +01:00
Milan Crha 079bfc9e92 I#1763 - Composer: Correct line wrapping with a link followed by a text
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1763
2022-01-14 10:37:56 +01:00
Milan Crha 8565d0d68e Composer: Various changes for Plain Text re-quote
* Unlinkify mailto: anchors, which causes trouble on wrapping inside quoted text.
* Merge consecutive text nodes before wrapping to simplify the algorithm
2022-01-13 16:56:51 +01:00
Milan Crha 0fc6bf5804 Composer: Special-case requote of BLOCKQUOTE nodes in Plain Text mode
While the BLOCKQUOTE node is considered a clock node, it's not a real
block node for paragraph quoting, thus special-case it and requote
its content instead.

This could exhibit in certain occasions when deleting content inside
quoted part using Backspace or Delete keys.
2022-01-13 15:40:56 +01:00
Milan Crha f921781c79 Composer: Backup from toplevel BLOCKQUOTE on split for Undo/Redo
As the split (after Enter key press) splits the BLOCKQUOTE up to
the BODY, it's necessary to backup all of that. Otherwise, when
splitting in the second or higher BLOCKQUOTE level, the undo does
not have correct information and misbehaves.
2022-01-13 15:38:09 +01:00
Milan Crha a019ade24d Load JavaScript plugins for message preview and WebKit editor
This allows to save JavaScript plugins, files with .js extension,
into `$PREFIX/share/evolution/webkit/preview-plugins/` or into
`~/.local/share/evolution/preview-plugins/` for the message preview
and into `$PREFIX/share/evolution/webkit/webkit-editor-plugins/` or
into `~/.local/share/evolution/webkit-editor-plugins/` for
the WebKit composer.

The plugin is an object, which contains two members:
* `name` - a string with a name of the plugin
* `setup(doc)` - a setup function

The argument of the `setup` function is a `document`, which can
be either the main document or an iframe document. The function
can be called multiple times for the same document.

The preview plugin registers itself by calling `Evo.RegisterPlugin(plugin_instance)`.

The WebKit editor plugin registers itself by calling `EvoEditor.RegisterPlugin(plugin_instance)`.
2021-11-25 11:01:38 +01:00
Milan Crha 6e46217384 I#1708 - Composer: Wrap quoted long words
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1708
2021-11-24 14:51:48 +01:00
Milan Crha c61022b004 I#1657 - Composer: Correct empty paragraph detection for removal
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1657
2021-10-12 16:13:45 +02:00
Milan Crha 7bd2ce8a11 I#1536 - Allow to delete an inserted image/rule in HTML composer
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1536
2021-06-14 19:24:24 +02:00
Milan Crha 91d4f2229e I#1469 - Composer: Signatures in HTML inserted into the quote on reply
It could happen when replying to a message composed by Evolution 3.38.1
and earlier.

Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1469
2021-06-10 13:26:40 +02:00
Milan Crha f8e567b5b9 I#1392 - Pressing backspace in front of quoted line with link does not delete anything
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1392
2021-05-12 17:56:39 +02:00
Milan Crha 8320752199 I#1439 - Composer: Paste single-line HTML without DIV into LI
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1439
2021-03-24 17:34:52 +01:00
Milan Crha 9debad14e2 Composer: Incorrect <BR> in quoted line with spaces only
Quoted lines with spaces only also added an extra <BR> when converting
from plain text, which leads to doubled quotation marks and misbehavior
when splitting the blockquote with the Enter key.
2021-03-23 18:08:35 +01:00
Milan Crha 529117f0e6 I#1424 - Composer: Paragraph format change should preserve BLOCKQUOTE
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1424
2021-03-19 12:01:35 +01:00
Milan Crha f3bcbb37f5 I#1159 - Composer: Removing highlighted quoted section creates empty quoted lines
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1159
2021-03-10 17:33:16 +01:00
Milan Crha 8ec17e104c Composer: Correct typo in node property names 2021-03-10 15:57:08 +01:00
Milan Crha 1f07a428f3 I#1394 - Composer: Incorrect wrap in citation with a long link
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1394
2021-03-09 13:32:39 +01:00
Milan Crha 68587dd05e I#1391 - Composer: Changing quoted line from Normal to Preformatted changes its quotation level
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1391
2021-03-09 10:00:14 +01:00
Milan Crha 01d596cae4 I#1398 - Composer: Fails to delete column/row of a table
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1398
2021-03-01 15:20:05 +01:00
Milan Crha 99c485049b I#1344 - Composer: Paragraph format change misbehaves on empty paragraph
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1344
2021-02-24 12:25:48 +01:00
Milan Crha 6a7df753b5 I#1365 - Composer: Nested quoted text can get lost in Reply on HTML mail
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1365
2021-02-15 15:19:50 +01:00
Milan Crha 5ee60af2a2 Composer: Add an option to prefer PRE on paste of a plain text
Let the user choose whether paste of the plain text should be pasted
as a normal paragraph or a preformatted paragraph.

Related to https://gitlab.gnome.org/GNOME/evolution/-/issues/1269
2021-01-28 17:57:24 +01:00
Milan Crha 3b95e570e4 I#1157 - Composer: Quoted text visually changes linewrap after paste
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1157
2021-01-20 12:32:44 +01:00
Milan Crha c14ce7fd76 I#1330 - Composer: Invalid wrapping with a space at the end of the line
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1330
2021-01-20 11:19:48 +01:00
Milan Crha 6c5c15900c I#1314 - templates: Quoted body shown incorrectly in Plain Text mode
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1314
2021-01-13 18:13:09 +01:00
Milan Crha c8da9c28b6 e-editor.js: Correct variable name in EvoEditor.InsertSignature()
Typo in the variable name, it was meant to be `uid`, but `id` was used
in the code instead.
2021-01-13 15:16:31 +01:00
Milan Crha 4cd97ac7fa I#1269 - Composer: Paste plain text as Preformatted
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1269
2021-01-13 10:51:17 +01:00
Milan Crha 461c01ad07 Composer: UL/OL not wrapped properly in Plain Text mode
In the Plain Text mode, when changing paragraph format to UL/OL, its width
was not properly set, which drew the long lines unwrapped. Switching to HTML
mode and back did set the expected wrap width.

Similarly, when converting HTML into plain text (on send), the wrap width did
not count width of the UL/OL prefix, making the line longer than it should be.
2020-12-02 13:57:19 +01:00
Milan Crha 1354aa5da4 I#1214 - Composer: Block format change from UL/OL can split BODY
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1214
2020-11-09 19:22:17 +01:00
Milan Crha 9c84a78a3d I#1207 - Composer: Magic-links can reposition caret to incorrect place
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1207
2020-11-05 16:55:30 +01:00
Milan Crha 6e72a16380 I#1204 - Composer: Remove signature hints on message send
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1204
2020-11-03 17:06:40 +01:00
Milan Crha 2001ba51d8 I#913 - Switching to plain-text keeps signature's HTML formatting
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/913
2020-11-03 13:37:48 +01:00
Milan Crha f24cd2a8cf I#1197 - Composer: BACKSPACE key on empty line simulates DEL key
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1197
2020-11-03 10:36:15 +01:00
Milan Crha 0930bc7209 I#1158 - Composer: Disable spellcheck of quoted text ][
Correct typo in the previous commit.

Related to https://gitlab.gnome.org/GNOME/evolution/-/issues/1158
2020-10-15 14:55:34 +02:00
Milan Crha c84b6a5cbd I#1158 - Composer: Disable spellcheck of quoted text
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1158
2020-10-15 14:52:54 +02:00
Milan Crha e913552a59 e-editor.js: EvoEditor.LoadHTML: Preserve theme CSS
To preserve the look as the theme defines it.
2020-06-05 09:32:32 +02:00
Milan Crha 7d5dbf03d9 Composer: Asks for format change on Plain Text draft open
The composer asked for format change from HTML to Plain Text when
opening Plain Text draft message, due to missing attribute in the draft.
2020-06-05 09:19:24 +02:00
Milan Crha 34e28ff149 I#966 - Composer: Correct caret placement around signature wrapper
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/966
2020-06-04 17:50:48 +02:00
Дилян Палаузов c07bca12e0 M!53 - data/webkit/*.js: change the emacs mode to JavaScript
Closes: https://gitlab.gnome.org/GNOME/evolution/-/merge_requests/53
2020-05-12 07:52:23 +00:00
Milan Crha 30986bcd41 I#783 - e-editor.js: Remove body margin/padding styles and attributes
Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/783
2020-05-06 19:09:04 +02:00
Milan Crha 28e24e0297 e-editor.js: Block format change doesn't set DIV width in Plain Text mode 2020-04-29 14:23:20 +02:00
Milan Crha 6d39ec9824 e-editor.js: Remove all body attributes when using Plain Text mode 2020-04-29 13:48:33 +02:00
Milan Crha edab7d02a8 e-editor.js: Fix various issues related to citation editing 2020-04-29 12:56:37 +02:00
Milan Crha dded38ef58 e-editor.js: Normalize blockquote-s for replies/forwards
Noticed on a Gmail generated quotation, which broke the editor/convert code.
2020-04-28 17:24:39 +02:00
Milan Crha 9ebe232b79 e-editor.js: Remove insignificant new lines when pre-processing loaded HTML
Insignificant new lines in the text are those in regular <div> and such,
where the white-space style doesn't mean to keep them. Those could cause
trouble when switching from HTML to the Plain Text mode, like to have doubled
new lines. WebKit doesn't remove them on its own, unfortunately, thus this
special processing is needed.
2020-04-28 10:45:01 +02:00