Coder Social home page Coder Social logo

lucaslsl / ngwig Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stevermeister/ngwig

0.0 2.0 0.0 668 KB

simple WYSIWYG editor for AgularJS

Home Page: http://stevermeister.github.io/ngWig/

License: MIT License

CSS 20.72% HTML 26.16% JavaScript 53.12%

ngwig's Introduction

ngWig

##Usage it's just attribute directive for textarea:

<textarea ng-wig="text1" class="editor1"></textarea>

##Installation

ngWig could be simply installed via npm:

npm install ng-wig

or via bower:

bower install ng-wig

More information on ngWig site

[Demo] (http://stevermeister.github.io/ngWig/demo/)

![Screenshot] (http://stevermeister.github.io/ngWig/images/ng-wig-demo.png)

##OnPaste Hook

If you need access to the pasted content you can provide a function to be called when paste event is fired.

// in your controller
var doSomething = function(pasteContent){
    return pasteContent.slice(0, 33);
};

$scope.onPaste = function(pasteEvent, originalTextContent){
    // here you can cancel the event
    // or just alter the pasteContent
    var pasteContent = (pasteEvent.originalEvent || pasteEvent).clipboardData.getData('text/plain');
    // here you can return the new content using a promise
    return $q.when(originalTextContent + paste.content.slice(0, 33));
    // or just paste
    //document.execCommand('insertHTML', false, doSomething(pasteContent));
};
<textarea ng-wig="text1" on-paste="onPaste" class="editor1"></textarea>

Development Setup

npm install
npm run devSetup

ngwig's People

Contributors

bampakoa avatar besuhoff avatar bolelamx avatar dmitry-egorov avatar drwebmaker avatar gitter-badger avatar justinwinslow avatar lucaslsl avatar micc83 avatar sashless avatar sketchynix avatar stevermeister avatar volodziu 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.