All Projects → KillerCodeMonkey → Ng Quill

KillerCodeMonkey / Ng Quill

Licence: mit
AngularJS Component for Quill rich text editor

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ng Quill

Flutter Quill
Rich text editor for Flutter
Stars: ✭ 177 (-20.63%)
Mutual labels:  rich-text-editor, rich-text, wysiwyg, wysiwyg-editor, quilljs
Ngx Quill
Angular (>=2) components for the Quill Rich Text Editor
Stars: ✭ 1,382 (+519.73%)
Mutual labels:  rich-text-editor, rich-text, wysiwyg, quilljs, ng
Angular Editor
A simple native WYSIWYG editor component for Angular 6 -10+
Stars: ✭ 428 (+91.93%)
Mutual labels:  rich-text-editor, rich-text, wysiwyg, wysiwyg-editor
Element Tiptap
🌸A modern WYSIWYG rich-text editor using tiptap and Element UI for Vue.js
Stars: ✭ 481 (+115.7%)
Mutual labels:  rich-text-editor, rich-text, wysiwyg, wysiwyg-editor
Textbus
基于组件 + 数据驱动的现代富文本编辑器
Stars: ✭ 242 (+8.52%)
Mutual labels:  rich-text-editor, rich-text, wysiwyg, wysiwyg-editor
textbus
Textbus 是一个组件化的、数据驱动的富文本框架,支持在线协同编辑,同时也可以作为一个开箱即用的富文本编辑器,拥有非常好的扩展性和可定制性,是构建复杂富文本的不二之选!
Stars: ✭ 642 (+187.89%)
Mutual labels:  wysiwyg, rich-text-editor, wysiwyg-editor, rich-text
Text
📑 Collaborative document editing using Markdown
Stars: ✭ 282 (+26.46%)
Mutual labels:  rich-text-editor, rich-text, wysiwyg, wysiwyg-editor
Tiptap
The headless editor framework for web artisans.
Stars: ✭ 13,629 (+6011.66%)
Mutual labels:  rich-text, wysiwyg, wysiwyg-editor
Ckeditor5
Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
Stars: ✭ 5,406 (+2324.22%)
Mutual labels:  rich-text-editor, wysiwyg, wysiwyg-editor
Wysiwyg Editor
The next generation Javascript WYSIWYG HTML Editor.
Stars: ✭ 4,756 (+2032.74%)
Mutual labels:  rich-text-editor, wysiwyg, wysiwyg-editor
Canner Slate Editor
📝Rich Text / WYSIWYG Editor built for Modularity and Extensibility.
Stars: ✭ 1,071 (+380.27%)
Mutual labels:  rich-text-editor, wysiwyg, wysiwyg-editor
Re Editor
一个开箱即用的React富文本编辑器 🚀re-editor
Stars: ✭ 367 (+64.57%)
Mutual labels:  rich-text-editor, wysiwyg, wysiwyg-editor
Wysiwyg.js
wysiwyg contenteditable editor (minified+compression: 6kb)
Stars: ✭ 520 (+133.18%)
Mutual labels:  rich-text-editor, wysiwyg, wysiwyg-editor
Ngx Quill Example
demo app for the advanced usage of ngx-quill module
Stars: ✭ 137 (-38.57%)
Mutual labels:  rich-text-editor, wysiwyg, quilljs
Slate Plugins
🔌 Next-gen slate plugins
Stars: ✭ 399 (+78.92%)
Mutual labels:  rich-text-editor, wysiwyg, wysiwyg-editor
Simditor
An Easy and Fast WYSIWYG Editor
Stars: ✭ 4,926 (+2108.97%)
Mutual labels:  rich-text-editor, wysiwyg, wysiwyg-editor
Pell
📝 the simplest and smallest WYSIWYG text editor for web, with no dependencies
Stars: ✭ 11,653 (+5125.56%)
Mutual labels:  rich-text-editor, wysiwyg, wysiwyg-editor
Jodit
Jodit - Best WYSIWYG Editor for You
Stars: ✭ 947 (+324.66%)
Mutual labels:  rich-text-editor, wysiwyg, wysiwyg-editor
Megadraft
Megadraft is a Rich Text editor built on top of Facebook's Draft.JS featuring a nice default base of components and extensibility
Stars: ✭ 982 (+340.36%)
Mutual labels:  rich-text-editor, wysiwyg, wysiwyg-editor
Awesome Web Editor
🔨 Open source WEB editor summary
Stars: ✭ 306 (+37.22%)
Mutual labels:  rich-text-editor, wysiwyg, wysiwyg-editor

ng-quill Build Status

NPM

ng-quill is an Angular.js component for Quill rich text editor.

Donate/Support

If you like my work, feel free to support it. Donations to the project are always welcomed :)

PayPal: PayPal.Me/bengtler

Buy Me A Coffee

BTC Wallet Address: 3QVyr2tpRLBCw1kBQ59sTDraV6DTswq8Li

ETH Wallet Address: 0x394d44f3b6e3a4f7b4d44991e7654b0cab4af68f

LTC Wallet Address: MFif769WSZ1g7ReAzzDE7TJVqtkFpmoTyT

Examples

Installation

The new version is complete rewritten and is using QuillJS 1.x. For the latest old version (0.20.1) checkout the special branch for it.

Usage

  • load angular, quill, ngquill scripts in your index.html
  • original sources are in src-folder, build files are in dist-folder
  • add dependency to your app module var myAppModule = angular.module('quillTest', ['ngQuill']);
  • use ngQuillConfigProvider to overwrite global settings in your config-Block
  • use ngquill directive in your html <ng-quill-editor ng-model="message"></ng-quill-editor>
  • add this line to your css [ng-quill-editor] { display: block; }
  • if you use it in a form and you are resetting it via $setPristine() -> you have to set editor.setText('') -> it will add the error class only, if the model has ng-dirty class
  • add a custom toolbar using ng-quill-toolbar - it uses transclusion to add toolbar, avoids flickering and sets the modules toolbar config to the custom toolbar automatically:

Recommended Usage

<ng-quill-editor ng-model="title">
    <ng-quill-toolbar>
        <div>
            <span class="ql-formats">
                <button class="ql-bold" ng-attr-title="{{'Bold'}}"></button>
            </span>
            <span class="ql-formats">
                <select class="ql-align" ng-attr-title="{{'Aligment'}}">
                    <option selected></option>
                    <option value="center"></option>
                    <option value="right"></option>
                    <option value="justify"></option>
                </select>
                <select class="ql-align">
                    <option selected></option>
                    <option value="center"></option>
                    <option value="right"></option>
                    <option value="justify"></option>
                </select>
            </span>
        </div>
    </ng-quill-toolbar>
</ng-quill-editor>
  • customToolbarPosition - if you are working with a custom toolbar you can switch the position :). - default: top, possible values top, bottom

Full Quill Toolbar HTML

Alternative Usage

let app = angular.module('app', [ 'ngQuill' ])

app.constant('NG_QUILL_CONFIG', {
  /*
   * @NOTE: this config/output is not localizable.
   */
  modules: {
    toolbar: [
      ['bold', 'italic', 'underline', 'strike'],        // toggled buttons
      ['blockquote', 'code-block'],

      [{ 'header': 1 }, { 'header': 2 }],               // custom button values
      [{ 'list': 'ordered' }, { 'list': 'bullet' }],
      [{ 'script': 'sub' }, { 'script': 'super' }],     // superscript/subscript
      [{ 'indent': '-1' }, { 'indent': '+1' }],         // outdent/indent
      [{ 'direction': 'rtl' }],                         // text direction

      [{ 'size': ['small', false, 'large', 'huge'] }],  // custom dropdown
      [{ 'header': [1, 2, 3, 4, 5, 6, false] }],

      [{ 'color': [] }, { 'background': [] }],          // dropdown with defaults from theme
      [{ 'font': [] }],
      [{ 'align': [] }],

      ['clean'],                                         // remove formatting button

      ['link', 'image', 'video']                         // link and image, video
    ]
  },
  theme: 'snow',
  debug: 'warn',
  placeholder: '',
  readOnly: false,
  bounds: document.body,
  scrollContainer: null
})

app.config([
  'ngQuillConfigProvider',
  'NG_QUILL_CONFIG',

  function (ngQuillConfigProvider, NG_QUILL_CONFIG) {
    ngQuillConfigProvider.set(NG_QUILL_CONFIG)
  }
])

*see: ./src/ng-quill/app.provider('ngQuillConfig').config

Configuration

  • use ngQuillConfigProvider.set({modules: { ... }, theme: 'snow', placeholder: 'placeholder', formats: { ... }, bounds: document.body, readyOnly: false) to config toolbar module, other modules, default theme, allowed formats, ...
  • set theme name: theme="snow" (default: 'snow')
  • set readOnly: read-only="" (default: false) - requires true or false
  • overwrite global config for each editor: modules="modulesConfig"
  • set placeholder: placeholder="'Inser your text here'" or placeholder="''" for empty string
  • set bounds: bounds="...", change the default boundary element of the editor (document.body) - set it to 'self' and the editor element is used
  • override formats: formats="formatsArray", per default all quill formats are allowed
  • set max-length: max-length="5", adds validation for maxlength (sets model state to invalid and adds ng-invalid-maxlength class)
  • set min-length: min-length="5", adds validation for minlength (sets model state to invalid and adds ng-invalid-minlength class), only works for values > 1, if you only want to check if there is a value --> use required/ng-required
  • set strict: activate/deactivate strict editor mode (default: true)
  • set scrollingContainer: set html element or css selector that gets the scrollbars
  • use custom-options for adding for example custom font sizes (see example in demo.html) --> this overwrites this options globally !!!
  • format - default 'html', possible values 'json' | 'object' | 'html' | 'text', so you are able to set quill operation object, html or plain text to your model
  • styles - set dynamic inline editor styles - styles="{ backgroundColor: 'red' }"
  • sanitize - santize the model content if format is html (default: false)
  • debug - set debug level, allowed 'error', 'warn', 'log', true, false (default: 'warn')
  • trackChanges - check if only user (quill source user) or all change should be trigger model update, default user. Using all is not recommended, it cause some unexpected sideeffects. But useful for 3rd Party modules and blots to keep your model up to date
  • preserveWhitespace - default: false - possbility to use a pre-tag instead of a div-tag for the contenteditable area to preserve duplicated whitespaces | caution if used with syntax plugin Related issue

Callback/Outputs

  • onEditorCreated: triggered after editor is created and provides editor-object on-editor-created="myCallback(editor)"
  • onContentChanged: triggered after changes in the editor. Provides editor-object, html representation and text representation on-content-changed="myCallback(editor, html, text, content, delta, oldDelta, source)"
  • onSelectionChanged: triggered after text selection changed on-selection-changed="myCallback(editor, range, oldRange, source)" - content = quill editor content object, text = content as plain text, html = content as html string
  • onFocus: triggered if editor gets focus on-focus="myCallback(editor, source)"
  • onBlur: triggered if editor gets focus on-blur="myCallback(editor, source)"

Security Hint

Angular templates provide some assurance against XSS in the form of client side sanitizing of all inputs.

Ng-quill provides the config paramter sanitize to sanitize html-strings passed as ngModel to the component.

It is deactivated per default to avoid stripping content or styling, which is not expected.

But it is recommended to activate this option, if you are working with html strings as model values.

Advanced Usage and Configuration

After editor creation you can use everything from the ordinary quill editor -> listen to editorCreated and work with the editor instance in your controller like you want ;). Add modules, use the quill API or listen to Events. Keep in mind to use $timeout if you are listening / working with quill-Events and updating some $scope stuff to notify angular about it ;). Quill Documentation

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].