"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/modules/webkit-editor/e-webkit-editor.c" between
evolution-3.40.2.tar.xz and evolution-3.40.3.tar.xz

About: Evolution is a personal information management application that provides integrated mail, calendaring and address book functionality (GNOME desktop).

e-webkit-editor.c  (evolution-3.40.2.tar.xz):e-webkit-editor.c  (evolution-3.40.3.tar.xz)
skipping to change at line 1976 skipping to change at line 1976
webkit_editor_style_updated (wk_editor, FALSE); webkit_editor_style_updated (wk_editor, FALSE);
} }
static void static void
webkit_editor_insert_content (EContentEditor *editor, webkit_editor_insert_content (EContentEditor *editor,
const gchar *content, const gchar *content,
EContentEditorInsertContentFlags flags) EContentEditorInsertContentFlags flags)
{ {
EWebKitEditor *wk_editor; EWebKitEditor *wk_editor;
gboolean prefer_pre; gboolean prefer_pre;
gboolean cleanup_sig_id;
wk_editor = E_WEBKIT_EDITOR (editor); wk_editor = E_WEBKIT_EDITOR (editor);
/* It can happen that the view is not ready yet (it is in the middle of /* It can happen that the view is not ready yet (it is in the middle of
* another load operation) so we have to queue the current operation and * another load operation) so we have to queue the current operation and
* redo it again when the view is ready. This was happening when loading * redo it again when the view is ready. This was happening when loading
* the stuff in EMailSignatureEditor. */ * the stuff in EMailSignatureEditor. */
if (wk_editor->priv->webkit_load_event != WEBKIT_LOAD_FINISHED) { if (wk_editor->priv->webkit_load_event != WEBKIT_LOAD_FINISHED) {
webkit_editor_queue_post_reload_operation ( webkit_editor_queue_post_reload_operation (
wk_editor, wk_editor,
(PostReloadOperationFunc) webkit_editor_insert_content, (PostReloadOperationFunc) webkit_editor_insert_content,
g_strdup (content), g_strdup (content),
g_free, g_free,
flags); flags);
return; return;
} }
prefer_pre = (flags & E_CONTENT_EDITOR_INSERT_CONVERT_PREFER_PRE) != 0; prefer_pre = (flags & E_CONTENT_EDITOR_INSERT_CONVERT_PREFER_PRE) != 0;
cleanup_sig_id = (flags & E_CONTENT_EDITOR_INSERT_CLEANUP_SIGNATURE_ID) ! = 0;
if ((flags & E_CONTENT_EDITOR_INSERT_CONVERT) && if ((flags & E_CONTENT_EDITOR_INSERT_CONVERT) &&
!(flags & E_CONTENT_EDITOR_INSERT_REPLACE_ALL)) { !(flags & E_CONTENT_EDITOR_INSERT_REPLACE_ALL)) {
e_web_view_jsc_run_script (WEBKIT_WEB_VIEW (wk_editor), wk_editor ->priv->cancellable, e_web_view_jsc_run_script (WEBKIT_WEB_VIEW (wk_editor), wk_editor ->priv->cancellable,
"EvoEditor.InsertContent(%s, %x, %x, %x);", "EvoEditor.InsertContent(%s, %x, %x, %x);",
content, (flags & E_CONTENT_EDITOR_INSERT_TEXT_HTML) != 0 , FALSE, prefer_pre); content, (flags & E_CONTENT_EDITOR_INSERT_TEXT_HTML) != 0 , FALSE, prefer_pre);
} else if ((flags & E_CONTENT_EDITOR_INSERT_REPLACE_ALL) && } else if ((flags & E_CONTENT_EDITOR_INSERT_REPLACE_ALL) &&
(flags & E_CONTENT_EDITOR_INSERT_TEXT_HTML)) { (flags & E_CONTENT_EDITOR_INSERT_TEXT_HTML)) {
if ((strstr (content, "data-evo-draft") || if ((strstr (content, "data-evo-draft") ||
strstr (content, "data-evo-signature-plain-text-mode"))) { strstr (content, "data-evo-signature-plain-text-mode"))) {
e_web_view_jsc_run_script (WEBKIT_WEB_VIEW (wk_editor), w k_editor->priv->cancellable, e_web_view_jsc_run_script (WEBKIT_WEB_VIEW (wk_editor), w k_editor->priv->cancellable,
"EvoEditor.LoadHTML(%s);", content); "EvoEditor.LoadHTML(%s);", content);
if (cleanup_sig_id)
e_web_view_jsc_run_script (WEBKIT_WEB_VIEW (wk_ed
itor), wk_editor->priv->cancellable, "EvoEditor.CleanupSignatureID();");
return; return;
} }
/* Only convert messages that are in HTML */ /* Only convert messages that are in HTML */
if (!(wk_editor->priv->html_mode)) { if (!(wk_editor->priv->html_mode)) {
if (strstr (content, "<!-- text/html -->") && if (strstr (content, "<!-- text/html -->") &&
!strstr (content, "<!-- disable-format-prompt -->")) { !strstr (content, "<!-- disable-format-prompt -->")) {
if (!show_lose_formatting_dialog (wk_editor)) { if (!show_lose_formatting_dialog (wk_editor)) {
webkit_editor_set_html_mode (wk_editor, T RUE); webkit_editor_set_html_mode (wk_editor, T RUE);
e_web_view_jsc_run_script (WEBKIT_WEB_VIE W (wk_editor), wk_editor->priv->cancellable, e_web_view_jsc_run_script (WEBKIT_WEB_VIE W (wk_editor), wk_editor->priv->cancellable,
"EvoEditor.LoadHTML(%s);", conten t); "EvoEditor.LoadHTML(%s);", conten t);
if (cleanup_sig_id)
e_web_view_jsc_run_script (WEBKIT
_WEB_VIEW (wk_editor), wk_editor->priv->cancellable, "EvoEditor.CleanupSignature
ID();");
return; return;
} }
} }
} }
e_web_view_jsc_run_script (WEBKIT_WEB_VIEW (wk_editor), wk_editor ->priv->cancellable, e_web_view_jsc_run_script (WEBKIT_WEB_VIEW (wk_editor), wk_editor ->priv->cancellable,
"EvoEditor.LoadHTML(%s);", content); "EvoEditor.LoadHTML(%s);", content);
} else if ((flags & E_CONTENT_EDITOR_INSERT_REPLACE_ALL) && } else if ((flags & E_CONTENT_EDITOR_INSERT_REPLACE_ALL) &&
(flags & E_CONTENT_EDITOR_INSERT_TEXT_PLAIN)) { (flags & E_CONTENT_EDITOR_INSERT_TEXT_PLAIN)) {
gchar *html, **lines; gchar *html, **lines;
skipping to change at line 2069 skipping to change at line 2075
content, (flags & E_CONTENT_EDITOR_INSERT_TEXT_HTML) != 0 , TRUE, prefer_pre); content, (flags & E_CONTENT_EDITOR_INSERT_TEXT_HTML) != 0 , TRUE, prefer_pre);
} else if (!(flags & E_CONTENT_EDITOR_INSERT_CONVERT) && } else if (!(flags & E_CONTENT_EDITOR_INSERT_CONVERT) &&
!(flags & E_CONTENT_EDITOR_INSERT_REPLACE_ALL)) { !(flags & E_CONTENT_EDITOR_INSERT_REPLACE_ALL)) {
e_web_view_jsc_run_script (WEBKIT_WEB_VIEW (wk_editor), wk_editor ->priv->cancellable, e_web_view_jsc_run_script (WEBKIT_WEB_VIEW (wk_editor), wk_editor ->priv->cancellable,
"EvoEditor.InsertContent(%s, %x, %x, %x);", "EvoEditor.InsertContent(%s, %x, %x, %x);",
content, (flags & E_CONTENT_EDITOR_INSERT_TEXT_HTML) != 0 , FALSE, prefer_pre); content, (flags & E_CONTENT_EDITOR_INSERT_TEXT_HTML) != 0 , FALSE, prefer_pre);
} else { } else {
g_warning ("%s: Unsupported flags combination (0x%x)", G_STRFUNC, flags); g_warning ("%s: Unsupported flags combination (0x%x)", G_STRFUNC, flags);
} }
if (cleanup_sig_id)
e_web_view_jsc_run_script (WEBKIT_WEB_VIEW (wk_editor), wk_editor
->priv->cancellable, "EvoEditor.CleanupSignatureID();");
if (flags & E_CONTENT_EDITOR_INSERT_REPLACE_ALL) if (flags & E_CONTENT_EDITOR_INSERT_REPLACE_ALL)
webkit_editor_style_updated (wk_editor, TRUE); webkit_editor_style_updated (wk_editor, TRUE);
} }
static void static void
webkit_editor_get_content (EContentEditor *editor, webkit_editor_get_content (EContentEditor *editor,
guint32 flags, /* bit-or of EContentEditorGetContentFl ags */ guint32 flags, /* bit-or of EContentEditorGetContentFl ags */
const gchar *inline_images_from_domain, const gchar *inline_images_from_domain,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
 End of changes. 5 change blocks. 
0 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)