[evolution/wip/webkit-composer] EComposerPrivate: Save the information how the message is handled into BODY attributes



commit 209d0b7455c017a22a01cb783e77e74ade59be64
Author: Tomas Popela <tpopela redhat com>
Date:   Fri Feb 21 22:51:31 2014 +0100

    EComposerPrivate: Save the information how the message is handled into BODY attributes

 composer/e-composer-private.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index ca3d642..39090db 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -842,6 +842,8 @@ composer_move_caret (EMsgComposer *composer)
        dom_selection = webkit_dom_dom_window_get_selection (window);
 
        body = webkit_dom_document_get_body (document);
+       webkit_dom_element_set_attribute (
+               WEBKIT_DOM_ELEMENT (body), "data-message", "", NULL);
        new_range = webkit_dom_document_create_range (document);
 
        element = webkit_dom_document_get_element_by_id (document, "-x-evo-caret-position");
@@ -858,6 +860,8 @@ composer_move_caret (EMsgComposer *composer)
 
        /* If editing message as new don't handle with caret */
        if (composer->priv->is_from_message) {
+               webkit_dom_element_set_attribute (
+                       WEBKIT_DOM_ELEMENT (body), "data-edit-as-new", "", NULL);
                e_editor_selection_restore_caret_position (editor_selection);
                if (!html_mode)
                        e_editor_widget_quote_plain_text (editor_widget);
@@ -866,6 +870,12 @@ composer_move_caret (EMsgComposer *composer)
                return;
        }
 
+       /* When the new message is written from the beginning - note it into body */
+       if (composer->priv->is_from_new_message) {
+               webkit_dom_element_set_attribute (
+                       WEBKIT_DOM_ELEMENT (body), "data-new-message", "", NULL);
+       }
+
        list = webkit_dom_document_get_elements_by_class_name (document, "-x-evo-paragraph");
        signature = webkit_dom_document_query_selector (document, ".-x-evolution-signature", NULL);
        /* Situation when wrapped paragraph is just in signature and not in message body */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]