Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Latest commit

 

History

History
46 lines (33 loc) · 915 Bytes

README.md

File metadata and controls

46 lines (33 loc) · 915 Bytes

Quill Image URL Drop Module

A module for Quill rich text editor to allow images' URLs to be drag/dropped into the editor.

Usage

Script Tag

Copy quill-image-url-drop.js into your web root

<script src="quill-image-url-drop-module.js"></script>

Javascript

Register the module

Quill.register("modules/imageUrlDrop", QuillImageUrlDrop);

Specify the container that holds the images you want to drag/drop.

var quill = new Quill(editor, {
    // ...
    modules: {
      // ...
      imageUrlDrop: {
        container: ".some-container-holding-the-images-you-want-to-use"
      }
    }
});

HTML

Add the container with the class specified in your JS. Each image should have a data-url attribute containing the image's URL.

<div class="some-container-holding-the-images-you-want-to-use">
  <img src="<URL>" data-url="<URL>" />
</div>