Sha256: 04f684811dd622a38bec97a93620146266ecfa4174f4cb8723049cf6bead1ec6

Contents?: true

Size: 1.36 KB

Versions: 21

Compression:

Stored size: 1.36 KB

Contents

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

<script type="text/javascript">
    document.addEventListener("pandaCmsRichTextEditorLoaded", function() {
      console.debug("[Panda CMS] Called event listener: pandaCmsRichTextEditorLoaded 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

21 entries across 21 versions & 1 rubygems

Version Path
panda_cms-0.5.4 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.5.3 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.5.2 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.5.1 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.5.0 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.15 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.14 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.13 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.12 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.11 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.10 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.9 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.8 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.7 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.6 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.5 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.4 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.3 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.2 app/components/panda_cms/rich_text_component.html.erb
panda_cms-0.3.1 app/components/panda_cms/rich_text_component.html.erb