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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@orbeon/wpaint

v1.13.1-orbeon.1

Published

jQuery Paint Plugin - Orbeon fork

Readme

wPaint.js

A jQuery paint plugin.

Settings

Available options with notes, the values here are the defaults.

$('#elem').wPaint({
    mode                 : 'Pencil',         // drawing mode - Rectangle, Ellipse, Line, Pencil, Eraser
    lineWidthMin         : '0',              // line width min for select drop down
    lineWidthMax         : '10',             // line widh max for select drop down
    lineWidth            : '2',              // starting line width
    fillStyle            : '#FFFFFF',        // starting fill style
    strokeStyle          : '#FFFF00',        // start stroke style
    fontSizeMin          : '8',              // min font size in px
    fontSizeMax          : '20',             // max font size in px
    fontSize             : '12',             // current font size for text input
    fontFamilyOptions    : ['Arial', 'Courier', 'Times', 'Trebuchet', 'Verdana'],
    fontFamily           : 'Arial',          // active font family for text input
    fontTypeBold         : false,            // text input bold enable/disable
    fontTypeItalic       : false,            // text input italic enable/disable
    fontTypeUnderline    : false,            // text input italic enable/disable
    image                : null,             // preload image - base64 encoded data
    imageBg              : null,             // preload image bg, cannot be altered but saved with image
    drawDown             : null,             // function to call when start a draw
    drawMove             : null,             // function to call during a draw
    drawUp               : null,             // function to call at end of draw
    menu                 : ['undo','clear','rectangle','ellipse','line','pencil','text','eraser','fillColor','lineWidth','strokeColor'], // menu items - appear in order they are set
    menuOrientation      : 'horizontal'      // orinetation of menu (horizontal, vertical)
    menuOffsetX          : 5,                // offset for menu (left)
    menuOffsetY          : 5                 // offset for menu (top)
    menuTitles           : {                 // icon titles, replace any of the values to customize
                                'undo': 'undo',
                                'redo': 'redo',
                                'clear': 'clear',
                                'rectangle': 'rectangle',
                                'ellipse': 'ellipse',
                                'line': 'line',
                                'pencil': 'pencil',
                                'text': 'text',
                                'eraser': 'eraser',
                                'fillColor': 'fill color',
                                'lineWidth': 'line width',
                                'strokeColor': 'stroke color',
                                'bold': 'bold',
                                'italic': 'italic',
                                'underline': 'underline',
                                'fontSize': 'font size',
                                'fontFamily': 'font family'
                            },
    disableMobileDefaults: false             // disable default touchmove events for mobile (will prevent flipping between tabs and scrolling)
});

Update settings on the fly:

$('#elem').wPaint('image', '<image_data>');
$('#elem').wPaint('image', '/path/to/file.jpg');

Retrieve settings, if more than one it will return an array otherwise just the value.

console.log($('#elem').wPaint('strokeStyle'));            // #FFFF00
console.log($('.elem').wPaint('strokeStyle'));            // ['#FFFF00', '#FFFF00']

Retrieve paint object.

var wp = $('#wPaint').wPaint().data('_wPaint');
console.log(wp);                                          // {wPaint object}

Methods

$('#elem').wPaint('clear');

Examples

Init with image and some callbacks:

<div id="wPaint"></div>
down: <input id="canvasDown" type="text" />
move: <input id="canvasMove" type="text" />
up:   <input id="canvasUp" type="text" />

<script type="text/javascript">
    $("#wPaint").wPaint({
        image: <image_data>,
        drawDown: function(e, mode){ $("#canvasDown").val(this.settings.mode + ": " + e.pageX + ',' + e.pageY); },
        drawMove: function(e, mode){ $("#canvasMove").val(this.settings.mode + ": " + e.pageX + ',' + e.pageY); },
        drawUp: function(e, mode){ $("#canvasUp").val(this.settings.mode + ": " + e.pageX + ',' + e.pageY); }
    });
</script>

Init with background (bg is saved with image but cannot be altered):

<div id="wPaint"></div>

<script type="text/javascript">
    $("#wPaint").wPaint({
        image: './some/path/imagepreload.png',
        imageBg: './some/path/imagebg.png'
    });
</script>

Set image on the fly:

<div id="wPaint"></div>
    
<script type="text/javascript">
    $("#wPaint").wPaint();

    $('#wPaint').wPaint('image', '<image_data>')
</script>

Get image data:

<div id="wPaint"></div>
<img id="canvasImage" src=""/>

<script type="text/javascript">
    var imageData = $("#wPaint").wPaint("image");
            
    $("#canvasImage").attr('src', imageData);
</script>

Resources

License

MIT licensed

Copyright (C) 2011-2012 Websanova http://www.websanova.com