npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

tiny-edit

1.2.1-pre4.3 • Public • Published

tinyEdit v1.2.1-pre4.0001

Demo is available at:

Requirements

  1. AngularJS1.2.x
  2. Angular Sanitize1.2.x

Optional requirements

  1. Bootstrap 3.x for the default styles
  2. Font-Awesome 4.x for the default icons on the toolbar
  3. Rangy 1.x for better activeState detection and more dynamic plugins, also the selectionsaverestore module.

Where to get it

Run bower install tinyEdit from the command line. Include script tags similar to the following:

<script src='/bower_components/angular-sanitize/angular-sanitize.js'></script>
<script src='/bower_components/tinyEdit/tinyEdit.js'></script>

Usage

  1. Include angular-sanitize.js in your project using script tags
  2. Include tinyEdit.js
  3. Add a dependency to tinyEdit in your app module, for example: angular.module('myModule', ['tinyEdit']).
  4. Create an element to hold the editor and add an ng-model="htmlVariable" attribute where htmtlVariable is the scope variable that will hold the HTML entered into the editor:
<div text-angular ng-model="htmlVariable"></div>

OR

<text-angular ng-model="htmlVariable"></text-angular>

This acts similar to a regular AngularJS / form input if you give it a name attribute, allowing for form submission and AngularJS form validation.

Have fun!

Important Note: Though tinyEdit supports the use of all attributes in it's input, please note that angulars ng-bind-html WILL strip out all of your style attributes.

For Additional options see the github Wiki.

Issues?

tinyEdit uses execCommand for the rich-text functionality. That being said, its still a fairly experimental browser feature-set, and may not behave the same in all browsers - see http://tifftiff.de/contenteditable/compliance_test.html for a full compliance list. It has been tested to work on Chrome, Safari, Opera, Firefox and Internet Explorer 8+. If you find something, please let me know - throw me a message, or submit a issue request!

Developer Notes

When checking out, you need a node.js installation, running npm install will get you setup with everything to run the unit tests and minification.

License

This project is licensed under the MIT license.

Contributers

install

npm i tiny-edit

Downloadsweekly downloads

6

version

1.2.1-pre4.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability