Giter Site home page Giter Site logo

outsource / textangular Goto Github PK

View Code? Open in Web Editor NEW

This project forked from textangular/textangular

0.0 2.0 0.0 2.99 MB

A radically powerful Text-Editor/Wysiwyg editor for Angular.js! Create multiple editor instances, two-way-bind HTML content, watch editors for changes and more!

textangular's Introduction

textAngular v1.2.0

Build Status Coverage Status

Demo is available at: http://www.textangular.com

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

NOTE: If you are using angular-sanitize anywhere you need to pick one of angular-sanitize OR textAngular-sanitize as the latter is our fork of the angular-sanitize file so loading both may cause conflicts or unexpected behaviour.

Via Bower:

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

<script src='/bower_components/textAngular/dist/textAngular-sanitize.min.js'></script>
<script src='/bower_components/textAngular/dist/textAngular.min.js'></script>

Via CDNJS:

Include script tags similar to the following:

<script src='http://cdnjs.cloudflare.com/ajax/libs/textAngular/1.2.0/textAngular-sanitize.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/textAngular/1.2.0/textAngular.min.js'></script>

Via jsDelivr:

Include script tag similar to the following: (For details on how this works see: https://github.com/jsdelivr/jsdelivr#load-multiple-files-with-single-http-request)

<script src='http://cdn.jsdelivr.net/g/[email protected](textAngular-sanitize.min.js+textAngular.min.js)'></script>

Via Github

Download the code from https://github.com/fraywing/textAngular/releases/latest, unzip the files then add script tags similar to the following:

<script src='/path/to/unzipped/files/textAngular-sanitize.min.js'></script>
<script src='/path/to/unzipped/files/textAngular.min.js'></script>

Usage

  1. Include textAngular-sanitize.js or textAngular-sanitize.min.js in your project using script tags
  2. Include textAngularSetup.js then textAngular.js or textAngular.min.js
  3. Add a dependency to textAngular in your app module, for example: angular.module('myModule', ['textAngular']).
  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 textAngular 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?

textAngular 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

Special thanks to all the contributions thus far!

Including those from:

textangular's People

Contributors

asafdav avatar fraywing avatar gintau avatar jonathangawrych avatar kanakiyajay avatar kencaron avatar mathiasverraes avatar nadeesha avatar ooflorent avatar rajat-123 avatar slobo avatar uxtx avatar vossim avatar worldspawn avatar ztbrown avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.