[evolution/wip/mcrha/webkit-jsc-api: 219/292] Add EvoEditor.InsertHTML() wrapper for "insertHTML" command



commit 9759bf1048fb8951d66e47c579266d997c86181f
Author: Milan Crha <mcrha redhat com>
Date:   Mon Nov 4 12:01:10 2019 +0100

    Add EvoEditor.InsertHTML() wrapper for "insertHTML" command

 data/webkit/e-editor.js | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/data/webkit/e-editor.js b/data/webkit/e-editor.js
index ebad243d0a..2923f605cf 100644
--- a/data/webkit/e-editor.js
+++ b/data/webkit/e-editor.js
@@ -1014,6 +1014,17 @@ EvoEditor.Indent = function(increment)
        }
 }
 
+EvoEditor.InsertHTML = function(opType, html)
+{
+       EvoUndoRedo.StartRecord(EvoUndoRedo.RECORD_KIND_GROUP, opType, null, null, 
EvoEditor.CLAIM_CONTENT_FLAG_USE_PARENT_BLOCK_NODE | EvoEditor.CLAIM_CONTENT_FLAG_SAVE_HTML);
+       try {
+               document.execCommand("insertHTML", false, html);
+       } finally {
+               EvoUndoRedo.StopRecord(EvoUndoRedo.RECORD_KIND_GROUP, opType);
+               EvoEditor.maybeUpdateFormattingState(true);
+       }
+}
+
 document.onload = function() {
        /* Make sure there is a selection */
        if (!document.getSelection().baseNode) {


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