skip to Main Content

first, I’m french, so please my apologies for my bad english, I also had a serious stroke twenty years ago, so it’s quite difficult for me to understand new tools ( despite this, I still have somme good knowledge in php, html, mysql, css and javascript ) but I have some problems to understand how works quill and modules, by example, I would like to add an image resizer module, but I don’t succed.. Coul someone please help me, and show me the right way to do this kind of things ? ( with a piece of code by example, it should be very nice of uou)

Many thanks in advance,
Guillaume.

I have tried some tutoriel on internet but I don’t succed/ understand with those .. So I turn to you. Thanks in advance.
Guillaume.

2

Answers


  1. Chosen as BEST ANSWER

    Hello SmellyCat2 and all, thanks for your quick answer, I will try all you say by the future, if I understand google traduction..! smile.. ( I have, by example some trouble to understand what you mean by " triple-back-ticks ( to post some code ..) btw, my current problem is : I just can't resize an image, because I can't install the module and I don't know how to do it. any help with a code example please? ( thanks in advance, Guillaume yes, I think I got the "triple back-ticks " !

    <script>
    alert ("hello world ! ");
    </script>
    

    is it correct ? :) ( I guess yes ! :p ) Here is my current code :

    <html>
    
      <head>
        <meta charset="utf-8">
        <link href="https://cdn.quilljs.com/1.3.5/quill.snow.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="../dist/quill-emoji.css">
      </head>
    
      <body>
        <div class="container" style="position:relative;">
        
          <div id="quill-editor" style="max-height: 300px"></div>
        </div>
    
        <script src="https://cdn.quilljs.com/1.3.5/quill.js"></script>
        <script src="../modules/Resize.js"></script>
    
        <script type="text/javascript">
          var toolbarOptions = {
            container: [
              ['bold', 'italic', 'underline', 'strike'],
              ['blockquote', 'code-block'],
              [{ 'header': 1 }, { 'header': 2 }],
              [{ 'list': 'ordered' }, { 'list': 'bullet' }],
              [{ 'script': 'sub' }, { 'script': 'super' }],
              [{ 'indent': '-1' }, { 'indent': '+1' }],
              [{ 'direction': 'rtl' }],
              [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
              [{ 'color': [] }, { 'background': [] }],
              [{ 'font': [] }],
              [{ 'align': [] }],
              ['clean'],
    
              ['link', 'image', 'video']
            ],
            handlers: {
       
            }
          }
    
          var quill = new Quill('#quill-editor', {
            modules: {
              "toolbar": toolbarOptions,
    
        
            },
            placeholder: 'Compose an epic...',
            theme: 'snow',
          });
        </script>
      </body>
    
    </html>
    

    And if I try to add resize module, by this way :

     var toolbarOptions = {
            container: [
              ['bold', 'italic', 'underline', 'strike'],
              ['blockquote', 'code-block'],
              [{ 'header': 1 }, { 'header': 2 }],
              [{ 'list': 'ordered' }, { 'list': 'bullet' }],
              [{ 'script': 'sub' }, { 'script': 'super' }],
              [{ 'indent': '-1' }, { 'indent': '+1' }],
              [{ 'direction': 'rtl' }],
              [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
              [{ 'color': [] }, { 'background': [] }],
              [{ 'font': [] }],
              [{ 'align': [] }],
              ['clean'],
    
              ['link', 'image', 'video']
              [{ 'resize': [] }],
            ],
            handlers: {
    
            }
          }
    

    the image' luploader option disappears.. so my problem is there, any help with that please ? :)

    thanks in advance, Guillaume


  2. To create a module in Node.js, you will need the exports keyword. This keyword tells Node.js that the function can be used outside the module.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search