title: Insert uploaded image to summernote editor
body: <p>My objective is to insert the uploaded image(local file) to the summernote editor.</p>
  
  <p>Image uploading successfully, only need to insert into the editor.</p>
  
  <p>I was trying to console log the editor instance, but it's showing undefined. If I can pass the editor instance to the <code>sendFile</code> function, I think the issue will be resolved.</p>
  
  <p><a href="https://jsfiddle.net/weodsagb/9/" rel="nofollow noreferrer">jsfiddle</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function () {
  
    $('.summernote').summernote({
      callbacks: {
       onImageUpload: function(files, editor, welEditable) {
        var url= sendFile(files[0], editor, welEditable);
      }
    },
    height: 300,
    focus: true,
  
  });
  
    function sendFile(file, editor, welEditable) {
      data = new FormData();
      data.append("file", file);
      console.log(editor);
      /* $.ajax({
        data: data,
        type: "POST",
        url: "Test/test",
        cache: false,
        contentType: false,
        processData: false,
        success: function(url) {
          editor.insertImage(welEditable, url);
          console.log(url); //eg:https://server-url/assets/images/a8f15ed.jpg
        },
        error: function(jqXHR, stat, err){
          console.log(stat+':'+err);
        }
      }); */
    }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;head&gt; 
  &lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet"/&gt;
  &lt;script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote-bs4.css" rel="stylesheet"/&gt;
  
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote-bs4.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  
  &lt;div class="container"&gt;
    &lt;div class="row"&gt;
      &lt;div class="col-md-3"&gt;
        &lt;div class="col-md-4"&gt;
          &lt;div class="summernote"&gt;&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>