Sha256: 0ad582beb772f3e6a4cbc95b3773a9c77e5d087d1c9832622d39a5041f70eb83

Contents?: true

Size: 1.37 KB

Versions: 8

Compression:

Stored size: 1.37 KB

Contents

<%= content_tag(:div, @content, @options) %>

<script type="text/javascript">
    document.addEventListener("pandaCmsExternalResourcesLoaded", function() {
      console.debug("[Panda CMS] Called event listener: pandaCmsExternalResourcesLoaded for <%= @options[:id] %>");

      // Allowing per-element toolbar configuration, if needed
      let quillOptions = {
        modules: {
          toolbar: [
            [{ header: [1, 2, 3, false] }],
            ["bold", "italic", "underline"],
            [{ list: "ordered" }, { list: "bullet" }],
            [{ script: "sub" }, { script: "super" }],
            [{ color: [] }, { background: [] }],
            [{ align: [] }],
            ["link", "image", "video", "code-block", "clean"],
          ],
          magicUrl: true,
          imageCompressor: {
            quality: 0.9,
            maxWidth: 2000,
            maxHeight: 2000,
            imageType: "image/png",
            keepImageTypes: ["image/jpeg", "image/jpg", "image/png"],
          },
        },
        theme: "bubble",
      };

      let quillVar = "<%= @options[:id] %>";
      console.debug(`[Panda CMS] Enabling Quill editor: ${quillVar}`);

      console.debug(`[Panda CMS] Quill options for ${quillVar}: `, quillOptions);

      Quill.register("modules/imageCompressor", imageCompressor);

      quillVar = new Quill("#" + quillVar, quillOptions);
    });
  </script>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
panda_cms-0.2.7 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.2.6 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.2.5 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.2.4 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.2.3 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.2.2 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.2.1 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.2.0 app/components/panda_cms/rich_text_component.html.erb