SHOW:
|
|
- or go back to the newest paste.
1 | <!DOCTYPE html> | |
2 | <html> | |
3 | <head> | |
4 | <meta charset="utf-8"> | |
5 | <meta name="viewport" content="width=device-width"> | |
6 | <title>JS Bin</title> | |
7 | <!-- https://quilljs.com/docs/formats --> | |
8 | - | <link href="https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.snow.css" rel="stylesheet" /> |
8 | + | <link href="https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.bubble.css" rel="stylesheet" /> |
9 | <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script> | |
10 | <script src="https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.js"></script> | |
11 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css" | |
12 | /> | |
13 | <style> | |
14 | #editor {margin-top:4em;} | |
15 | </style> | |
16 | - | <div id="toolbar-container"> |
16 | + | |
17 | - | <span class="ql-formats"> |
17 | + | |
18 | - | <button class="ql-header" value="2"></button> |
18 | + | |
19 | - | <button class="ql-bold"></button> |
19 | + | <div id="editor"></div> |
20 | - | <button class="ql-italic"></button> |
20 | + | |
21 | - | <button class="ql-strike"></button> |
21 | + | <script> |
22 | - | <button class="ql-link"></button> |
22 | + | const toolbarOptions = ['bold', 'italic', 'strike','code-block']; |
23 | - | <button class="ql-script" value="sub"></button> |
23 | + | const quill = new Quill('#editor', { |
24 | - | <button class="ql-script" value="super"></button> |
24 | + | theme: 'bubble', |
25 | - | <button class="ql-blockquote"></button> |
25 | + | placeholder: 'Compose an epic...', |
26 | - | <button class="ql-code-block"></button> |
26 | + | modules: { |
27 | - | </span> |
27 | + | toolbar: toolbarOptions, |
28 | - | <span class="ql-formats"> |
28 | + | syntax: true, |
29 | - | <select class="ql-align"></select> |
29 | + | }, |
30 | - | <button class="ql-list" value="ordered"></button> |
30 | + | }); |
31 | - | <button class="ql-list" value="bullet"></button> |
31 | + | </script> |
32 | - | <button class="ql-indent" value="-1"></button> |
32 | + | |
33 | - | <button class="ql-indent" value="+1"></button> |
33 | + | |
34 | - | <button class="ql-clean"></button> |
34 | + |