RichText/Archived/Rooster/Rooster.gcomp/Support/node_modules/roosterjs/dist/rooster-amd.js
/**
 * Insert an image to editor at current selection
 * @param editor The editor instance
 * @param imageFile The image file. There are at least 3 ways to obtain the file object:
 * From local file, from clipboard data, from drag-and-drop
 */
Insert an image to editor at current selection
@param editor The editor instance
@param imageFile The image file. There are at least 3 ways to obtain the file object:
From local file, from clipboard data, from drag-and-drop
Insert an image to editor at current selection @param editor The editor instance @param imageFile The image file . There are at least 3 ways to obtain the file object : From local file from clipboard data from drag - and - drop
function insertImage(editor, imageFile) {
    var reader = new FileReader();
    reader.onload = function (event) {
        if (!editor.isDisposed()) {
            editor.addUndoSnapshot(function () {
                var image = editor.getDocument().createElement('img');
                image.src = event.target.result;
                image.style.maxWidth = '100%';
                editor.insertNode(image);
            }, "Format" );
        }
    };
    reader.readAsDataURL(imageFile);
}
function insertImage ( editor , imageFile ) { var reader = new FileReader ( ) ; reader . onload = function ( event ) { if ( ! editor . isDisposed ( ) ) { editor . addUndoSnapshot ( function ( ) { var image = editor . getDocument ( ) . createElement ( 'img' ) ; image . src = event . target . result ; image . style . maxWidth = '100%' ; editor . insertNode ( image ) ; } , "Format" ) ; } } ; reader . readAsDataURL ( imageFile ) ; }
Insert an image to editor at current selection
 @param editor The editor instance
 @param imageFile The image file.
Insert an image to editor at current selection @param editor The editor instance @param imageFile The image file .
/* Format */