npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng-wig

v3.1.1

Published

ngWig =====

Downloads

1,789

Readme

ngWig

Dependencies

it's only AngularJS! No jQuery or other WYSIWYG monsters

  • ng-wig2+ - Angular1.3+
  • ng-wig3+ - Angular1.5+

Also suports latest Angular1.7.8

Usage

angular.module('yourApp', ['ngWig'])

it's just attribute directive for textarea:

<ng-wig ng-model="text1"></ng-wig>

Sanitization

Important: ngWig is light weight solution that does not include sanitization module. So it's your own responsiblity to be sure that content that you placed there is already checked and does not have any possible injections. Credits to @MacJu for highlighting the issue.

Installation

ngWig could be simply installed via npm:

npm install ng-wig

or via bower:

bower install ng-wig

CDN

https://cdnjs.cloudflare.com/ajax/libs/ng-wig/3.0.14/ng-wig.min.js

https://cdnjs.cloudflare.com/ajax/libs/ng-wig/3.0.14/ng-wig.js

https://cdnjs.cloudflare.com/ajax/libs/ng-wig/3.0.14/css/ng-wig.css

Always last version CDN

https://cdn.jsdelivr.net/gh/stevermeister/ngWig@master/dist/ng-wig.min.js

https://cdn.jsdelivr.net/gh/stevermeister/ngWig@master/dist/ng-wig.js

https://cdn.jsdelivr.net/gh/stevermeister/ngWig@master/dist/css/ng-wig.css

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

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

Examples

Quick start (plunker)

<ng-wig ng-model="text1"></ng-wig>

Disabled (plunker)

<ng-wig ng-model="text1" ng-disabled="true"></ng-wig>

Edit Source option (plunker)

<ng-wig ng-model="text1" source-mode-allowed></ng-wig>

Placeholder (plunker)

<ng-wig ng-model="text1" placeholder="'Enter instructions here.'"></ng-wig>

ngModel sync (plunker)

<ng-wig ng-model="text1"></ng-wig>
<ng-wig ng-model="text1"></ng-wig>

Set buttons (plunker)

<ng-wig ng-model="text1" buttons="formats, bold, italic"></ng-wig>

Setup generic buttons (plunker)

.config(['ngWigToolbarProvider', function(ngWigToolbarProvider) {
  ngWigToolbarProvider.setButtons(['bold', 'italic']);
}]);

Add standard buttons (plunker)

.config(['ngWigToolbarProvider', function(ngWigToolbarProvider) {
  ngWigToolbarProvider.addStandardButton('underline', 'Underline', 'underline', 'fa-underline');
}]);

Add custom button (plugin) (plunker)

  • Javascript:

      angular.module('ngWig').config(['ngWigToolbarProvider', function(ngWigToolbarProvider) {
          ngWigToolbarProvider.addCustomButton('my-custom', 'nw-my-custom-button');
      }])
      .component('nwMyCustomButton', {
          template: '<button class="nw-button my-custom" title="My Custom Button" ng-click="$ctrl.click()">My Custom Button</button>',
          controller: function() {
              this.click = function(){
                  alert('My Custom Button');
              };
          }
      });
  • CSS:

      .nw-button.my-custom:before {
          content: '\f1b3';
      }

OnPaste Hook (plunker)

    <ng-wig ng-model="text1" on-paste="onPaste($event, pasteContent)"></ng-wig>

Formats (plugin) (plunker)

    <ng-wig ng-model="text1" buttons="formats"></ng-wig>

Forecolor (plugin) (plunker)

    <ng-wig ng-model="text1" buttons="forecolor"></ng-wig>

Clear Styles (plugin) (plunker)

    <ng-wig ng-model="text1" buttons="clear-styles"></ng-wig>

Contribution (Development Setup)

npm install
npm run devSetup

Creating plugins