[evolution/wip/mcrha/webkit-jsc-api] e-editor.js: Change file:// to evo-file:// on image insert



commit eede30bef45cf89fefa83c308fb19836a945fbaf
Author: Milan Crha <mcrha redhat com>
Date:   Tue Mar 10 14:37:20 2020 +0100

    e-editor.js: Change file:// to evo-file:// on image insert
    
    Otherwise the image is not shown (loaded) inside message body.

 data/webkit/e-editor.js | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/data/webkit/e-editor.js b/data/webkit/e-editor.js
index 029261466b..93674f2614 100644
--- a/data/webkit/e-editor.js
+++ b/data/webkit/e-editor.js
@@ -3722,6 +3722,9 @@ EvoEditor.MoveSelectionToPoint = function(xx, yy, cancel_if_not_collapsed)
 
 EvoEditor.createEmoticonHTML = function(text, imageUri, width, height)
 {
+       if (imageUri.toLowerCase().startsWith("file:"))
+               imageUri = "evo-" + imageUri;
+
        if (imageUri && EvoEditor.mode == EvoEditor.MODE_HTML && !EvoEditor.UNICODE_SMILEYS)
                return "<img src=\"" + imageUri + "\" alt=\"" +
                        text.replace(/\&/g, "&amp;").replace(/\"/g, "&quot;").replace(/\'/g, "&apos;") +
@@ -3737,6 +3740,9 @@ EvoEditor.InsertEmoticon = function(text, imageUri, width, height)
 
 EvoEditor.InsertImage = function(imageUri, width, height)
 {
+       if (imageUri.toLowerCase().startsWith("file:"))
+               imageUri = "evo-" + imageUri;
+
        var html = "<img src=\"" + imageUri + "\"";
 
        if (width > 0 && height > 0) {


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