Commit Graph

1803 Commits

Author SHA1 Message Date
2a9becc430 Bug 770067 - [WK2] Misplaced cursor on reply in HTML
The wrong code path was chosen because the code determined that the BODY
already contains an existing paragraph on the end of the content. The
fix it to not take the credits element into account when determining if the
BODY already contains the paragraphs.
2016-10-03 14:36:40 +02:00
20cc9a7384 Bug 772171 - Editing quoted replies can break message content
Don't save the selection again in
e_editor_dom_fix_structure_after_delete_before_quoted_content() as later
the selection markers are not used to restore the selection, but they
would prevent the delete operation to process correctly.

Also restore the selection on other places when we are not using it
anymore.
2016-10-03 13:44:05 +02:00
052fb97db1 When creating a plain text version of a message process the nodes in right order 2016-09-26 10:59:58 +02:00
adcbacd46e Correctly process a WebKitDOMHTMLCollection objects
WebKitDOMHTMLCollection is a live list, so we can't process it like a static
list (like WebKitDOMNodeList). So process it correctly and while fixing it
rework the WebKitODMNodeList processing so we can get rid of the length
variable.
2016-09-26 10:04:08 +02:00
3655fe5fde Pressing the Backspace key to decrease indentation level is wrong for content that was not written in Evolution 2016-09-23 13:27:14 +02:00
16b7ed974a Some text could be skipped when converting the HTML to plain text
The citation token could appear before the <br> one. Look for both of them and
start from the one that is closer to the beginning.
2016-09-23 13:27:14 +02:00
0104d2cd8b Optimize various DOM operations when searching elements
Replace various *query_selector* functions with their alternatives that don't
need to parse input to figure out what we are trying to look for.
2016-09-23 13:27:14 +02:00
932d4984c9 Optimise how a quote element is created 2016-09-23 13:27:14 +02:00
211d7f975c Fix the indentation
Replace tabulators with spaces when needed.
2016-09-23 13:27:14 +02:00
8ad100216e Bug 770662 - [WK2] Leading space disappears on paragraph format change
Make the paragraph use the "white-space: pre-wrap" style to preserve whitespaces.
2016-09-22 12:47:06 +02:00
7d50a09c65 Simplify a bit how the selection is saved 2016-09-22 11:26:32 +02:00
bf7d76bf0a Cannot switch the list type when it has just one level
Remove the original list after we insert a newly created one, otherwise
the newly created one won't be added to the DOM.
2016-09-22 11:24:28 +02:00
99578d9a5f Introduce new debug domains for WebKit parts
webkit:editor - things associated with EWebKitContentEditor
webkit:undo - things associated with undo and redo handling in EWebKitContentEditor
webkit:preview - things associated with message preview, printing, ...
webkit - things mentioned above together
2016-09-20 11:11:51 +02:00
c0f95526ff Extra new line on the end of mail and after citation end 2016-09-20 11:01:34 +02:00
d61929b1d3 Bug 771493 - Missing '>' in message reply
When parsing the HTML content to blocks we cannot look for the first "<br>"
token from the first position of input as when the input will start with the
same token, then we will later exit the processing loop prematurely as we won't
have a non-empty content to process.
2016-09-20 10:59:52 +02:00
f832a244d8 Missing declaration for DOMGetActiveSignatureUid 2016-09-20 10:59:52 +02:00
edb6656f20 Bug 771347 - Evolution's mail composer underlines my message even when spell checking is disabled
When doing reply don't forgot to turn off spell checking if it is disabled.
Also remove a code that was accidentally committed that was preventing the spell
check to perform.
2016-09-20 10:59:52 +02:00
1362feb764 Bug 771131 - Replying in plain text to plain text ignores quotation level
We were not inserting the citation start marker in parse_html_into_blocks() when
it was after the text to process and the line did not started with BR element.
Only the citation end mark was inserted in this case, thus the citation was not
constructed properly.
2016-09-12 09:58:19 +02:00
6508dacc5f An extra quote character is inserted on the end of an empty PRE element
Don't insert a new quote character if there is one already inserted before the
BR element.
2016-09-12 08:07:51 +02:00
dc40b309e4 After pressing the return key, caret is moved to a wrong place
Fix one query selector after the P -> DIV move.
2016-09-12 07:20:12 +02:00
3385f007d8 Use DIV instead of P element for 'Normal' block
While working on the WK2 port I decided to use P element for 'Normal' block
instead of DIV element. Now, it showed up that it was not a wise change as the
P element usually has some style defined by the web engine itself (usually
margins above and below) so the HTML message written in the Evolution's composer
won't look the same in other MUAs and actually not in the Evolution's preview as
well. Instead of adding some style attributes to every 'Normal' paragraph that
is being send basically revert the change and return back to DIV elements.
2016-09-09 09:57:48 +02:00
86dab2b755 Bug 771044 - [WK2] Composer deletes too much text
When saving the selection, only append the selection end mark to the end of the
container if the following statements are met:

* container is not text
* the offset is not 0 (that would be when the selection starts/end in the
  beginning of node)
* offset is bigger by one than the count of the container's children that are
  elements

For more see https://developer.mozilla.org/en-US/docs/Web/API/Range/endOffset

In the next cycle we really need to simplify the logic inside the
e_editor_dom_selection_save()..
2016-09-09 00:17:15 +02:00
3885b76176 Prefer OAuth2 authentication for Mail-only Google accounts
When a Mail-only Google account had been created in the Evolution,
it had set Plain password authentication, which requires an application
specific password, while an OAuth2 could be used instead.
2016-09-07 10:39:10 +02:00
4163018235 Change URL and e-mail pattern regular expressions
The evolution could crash when replying to an HTML message inside pcre
library recursion, which could cause stack overflow.

This had been reported downstream at:
https://bugzilla.redhat.com/show_bug.cgi?id=1370514
2016-09-06 18:41:14 +02:00
ecdac63faf Try to fix the "NL between tags" when inserting HTML into the editor
Don't use the regular expression that we used before - it's wrong as it will
also apply on PRE elements and we don't want that. When generating the plain
text version of the editor's content skip all the text nodes with '\n' content
when their parent is not a PRE element. Also remove the BR element (if
presented) from the current element when inserting a HTML content otherwise an
extra new block will be inserted.
2016-09-06 16:49:17 +02:00
a16658cfc2 e_editor_dom_move_quoted_block_level_up() is wrong for HTML mode
This function moves a current block in quoted content one level up, but only
when the caret is in the beginning of block. For HTML we were really not
checking that and we were just looking whether the current block is indeed a
citation element.
2016-09-06 16:49:17 +02:00
44e0129064 Correctly handle the undo operation the Backspace was pressed in the beginning of LI element 2016-09-06 16:49:17 +02:00
6c4519413f Selection end marker could be saved wrong in the quoted content 2016-09-06 16:49:17 +02:00
309214dc8c Save selection in save_history_for_delete_or_backspace()
and don't rely that it was saved in the caller (there indeed could be a case
when it did not happened).
2016-09-06 16:49:17 +02:00
968f675f26 Extra new line is inserted on the end of converted content
We have to remove the SPAN element that is used to notify us that we need to
quote the BODY content, otherwise it will cause an unwanted line break on the
end of the content.
2016-09-06 16:49:17 +02:00
1ac98f111f When removing empty blocks from citations, don't remove BR elements
We want to preserve line breaks, don't we?
2016-09-06 16:49:17 +02:00
cea7730819 Undoing a citation split could fail
When the caret is on the end of the citation and the Return key is pressed then
a new empty block is inserted after the current block in citation. When we later
try to undo this operation the newly added block will be removed as it should,
but the next block would be concatenated after the current citation.
2016-09-06 16:49:17 +02:00
d39762e2b8 Replace last usage of deprecated WebKit DOM API functions 2016-09-02 13:45:41 +02:00
1093ace557 Replace usage of deprecated WebKit DOM API functions 2016-09-02 12:09:38 +02:00
7c8ee5067c Adapt to WebKit Unstable DOM API changes in WebKitGTK+ 2.13.90
Also increase the minimal required WebKitGTK+ version.
2016-09-01 17:53:46 +02:00
43afbfdea4 Critical warning could be printed when replying on message with inline images
Name returned by camel_mime_part_get_filename() can be empty, count with it.
2016-08-31 15:42:42 +02:00
e7de96dc37 Remove CSS sheet from the DOM only when it exists 2016-08-31 15:42:42 +02:00
761ac9f004 [itip-formatter] Guess meeting time zone when not provided in the invitation
In case the meeting invitation component doesn't contain its timezone(s),
try to guess it from the given TZID, thus the time shown in the message
preview is properly converted into the local time zone.
2016-08-31 15:27:31 +02:00
169279e331 Report errors from D-Bus calls to WebExtension-s
There was not much error reporting when calling anything through D-Bus
to a WebExtension, but the failed calls could cause misbehavior.
The added warnings on console will help to spot such issues and
fix them.
2016-08-26 16:41:45 +02:00
6799fc9cd4 Undoing or redoing the font format changes does not reflect the changes in the UI
We need to notify the UI process about the changes that were made while
performing the undo and redo operations.
2016-08-23 15:28:35 +02:00
6201f0e7dd Redoing some events could fail
The problem is that we were not restoring the caret to the right position before
the event took place (and after it finished).
2016-08-23 15:28:35 +02:00
48f8ded91a PRE element could not be wrapped quoted correctly
We have to replace the new line characters with the BR elements and then select
them while quoting.
2016-08-23 15:28:35 +02:00
7082cee578 Undoing the style change should act like the separate history event
Previously we were jumping straight to the next item. This could cause problems
and also try to be consistent with LO Writer.
2016-08-23 10:05:47 +02:00
7d6ed77868 Redoing a font style change will not set the correct values to the EEditorPage 2016-08-23 10:05:47 +02:00
7134e8c167 Redoing the input event should remove the BR if it was the only node there
WebKit is doing the same when we are writing.
2016-08-23 10:05:47 +02:00
ca94746a39 Turning off the font formatting could leave empty elements in DOM
This was mostly caused by leaving the zero width space in the element and not
removing it.
2016-08-23 10:05:47 +02:00
1a3f2e1144 Bug 769753 - Cannot replace misspelled word from the context menu ][ 2016-08-23 07:15:35 +02:00
1b510ae25f Fix various extra new lines errors when processing the content 2016-08-19 16:46:00 +02:00
9ee8b61034 Font style cannot be set
The problem was that the value was set into the page through
e_editor_page_set_style_flag() and then later when we were manipulating the DOM
to actually set the style the change was rejected as the value of the style that
we were trying to set and the value from page was the same.
2016-08-19 16:46:00 +02:00
57bcf53240 Correct the indentation 2016-08-19 16:46:00 +02:00