All Projects → jdkanani → Smalleditor

jdkanani / Smalleditor

Licence: mit
Small WYSIWYG editor with delta save, inspired by Medium

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Smalleditor

Canner Slate Editor
📝Rich Text / WYSIWYG Editor built for Modularity and Extensibility.
Stars: ✭ 1,071 (+316.73%)
Mutual labels:  editor, wysiwyg-editor
My Vue Editor
a rich text editor for Vue 2.x
Stars: ✭ 129 (-49.81%)
Mutual labels:  editor, wysiwyg-editor
React Page
Next-gen, highly customizable content editor for the browser - based on React and written in TypeScript. WYSIWYG on steroids.
Stars: ✭ 8,704 (+3286.77%)
Mutual labels:  editor, wysiwyg-editor
Proton
Purely native and extensible rich text editor for iOS and macOS Catalyst apps
Stars: ✭ 685 (+166.54%)
Mutual labels:  editor, wysiwyg-editor
Nib
Wysiwyg / Text editor components built using React and Prosemirror
Stars: ✭ 181 (-29.57%)
Mutual labels:  editor, wysiwyg-editor
Jodit
Jodit - Best WYSIWYG Editor for You
Stars: ✭ 947 (+268.48%)
Mutual labels:  editor, wysiwyg-editor
Awesome Wysiwyg
A curated list of awesome WYSIWYG editors.
Stars: ✭ 1,801 (+600.78%)
Mutual labels:  editor, wysiwyg-editor
Angular Editor
A simple native WYSIWYG editor component for Angular 6 -10+
Stars: ✭ 428 (+66.54%)
Mutual labels:  editor, wysiwyg-editor
Pell
📝 the simplest and smallest WYSIWYG text editor for web, with no dependencies
Stars: ✭ 11,653 (+4434.24%)
Mutual labels:  editor, wysiwyg-editor
Rich Markdown Editor
The open source React and Prosemirror based markdown editor that powers Outline. Want to try it out? Create an account:
Stars: ✭ 2,468 (+860.31%)
Mutual labels:  editor, wysiwyg-editor
Sceditor
A lightweight HTML and BBCode WYSIWYG editor
Stars: ✭ 503 (+95.72%)
Mutual labels:  editor, wysiwyg-editor
Vue Editor Js
editor.js for Vue users
Stars: ✭ 205 (-20.23%)
Mutual labels:  editor, wysiwyg-editor
Core2d
A multi-platform data driven 2D diagram editor.
Stars: ✭ 475 (+84.82%)
Mutual labels:  editor, 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 (+282.1%)
Mutual labels:  editor, wysiwyg-editor
React Quill
A Quill component for React.
Stars: ✭ 4,739 (+1743.97%)
Mutual labels:  editor, wysiwyg-editor
Tiptap
The headless editor framework for web artisans.
Stars: ✭ 13,629 (+5203.11%)
Mutual labels:  editor, wysiwyg-editor
Re Editor
一个开箱即用的React富文本编辑器 🚀re-editor
Stars: ✭ 367 (+42.8%)
Mutual labels:  editor, wysiwyg-editor
Drawerjs
A customizable WYSIWYG HTML canvas editor.
Stars: ✭ 383 (+49.03%)
Mutual labels:  editor, wysiwyg-editor
Guppy
WYSIWYG mathematics editor with structured, searchable, LaTeX-compatible, and parseable output
Stars: ✭ 147 (-42.8%)
Mutual labels:  editor, wysiwyg-editor
Flutter Quill
Rich text editor for Flutter
Stars: ✭ 177 (-31.13%)
Mutual labels:  editor, wysiwyg-editor

Smalleditor

Small WYSIWYG editor with delta save

Inspired by Medium and MediumEditor.

Smalleditor uses model to save document - which makes autosaving, revisions and paragraph/word comments very easy to implement. If you are interested in its internals, read this - https://medium.com/medium-eng/why-contenteditable-is-terrible-122d8a40e480

For future developement please refer TODO section. If you need collaborative editor - I would suggest you to use quilljs.

###TODO###

  • Remove jQuery as dependency (WIP: different branch)
  • Refactor grunt setup
  • Support for more elements
  • IE/safari support
  • Test cases
  • Docs
  • Side comments

###Demo### Check out a sweet demo of smalleditor here: http://jdkanani.github.io/smalleditor

###How to use### Install using bower

bower install smalleditor

Include js and css

Dependencies: jQuery and angular.js

<link rel="stylesheet" href="bower_components/smalleditor/dist/css/smalleditor.css" type="text/css" media="screen" charset="utf-8">
<script src="bower_components/smalleditor/dist/js/smalleditor.min.js" type="text/javascript" charset="utf-8"></script>

Use smalleditor directive

<div smalleditor>
</div>

###Docs###

Buttons

Add buttons attribute:

<div smalleditor buttons="b,i,u,h1,h2,blockquote">
</div>

Icon theme

<div smalleditor buttons="b,i,u,h1,h2,blockquote" icontheme='bootstrap'>
</div>

Smalleditor APIs

Use api attribute in directive:

<div smalleditor api='editorApi' ng-controller='EditorController'>
</div>

In controller use that API to control revisions:

angular.module('smalleditorDemo', ['ngRoute', 'smalleditor'])
.controller('EditorController', ['$scope', function($scope) {
  $scope.$watch('editorApi', function(editor) {
    // Get current data model
    var baseDataModel = editor.dataModel();

    // After editing for a while get new data model
    var currentDataModel = editor.dataModel();

    // Compute delta between baseDataModel and currentDataModel
    var delta = editor.computeDelta(baseDataModel, currentDataModel);

    // Apply that delta to any revision to get next revision
    editor.applyDelta(nRevision, nDelta);
  });
}]);

###Utility###

Bind smalleditor model to div

//
//  Usage:
//
//       <div ng-model="story.content" smalleditor-bind></div>
//
//
angular.module('smalleditor').directive('smalleditorBind', [
  'SmalleditorCore',
  function(SmalleditorCore) {
    return {
      restrict: 'A',
      require: '?ngModel',
      link: function(scope, element, attrs, ngModel) {
        // Do nothing if no ng-model
        if(!ngModel) return;
        // Specify how UI should be updated
        ngModel.$render = function() {
          // Generate HTML from model and add it to element
          element.html(SmalleditorCore.generateHTMLFromModel(ngModel.$viewValue) || "");
        }
      }
    }
  }
]);

###LICENSE###

MIT

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].