npm.io
0.1.2 • Published 6 years ago

clipboar

Licence
MIT
Version
0.1.2
Deps
1
Size
213 kB
Vulns
0
Weekly
0
Stars
5

clipboar

npm version

A simple library for handling pasting and dropping content into a web page.

Usage

import { Clipboard, HandlerType } from 'clipboar';

const clipboard = new Clipboard();

// Add some handlers.
clipboard.addHandler( {
	type: HandlerType.PASTE,
	order: 5,
	handle( clipboardData, next ) {
		doSomething( clipboardData );

		next();
	}
} );

// Add some zones.
clipboard.addZone( document.querySelector( '#pasteArea', HandlerType.PASTE ) );

Contributing

After cloning this repository, install necessary dependencies:

npm install
Executing tests
npm run test

If you are going to change the source files (ones located in the src/ directory), remember about rebuilding the package. You can use npm run develop in order to do it automatically.

Building the package

Build a minified version of the package that is ready to publish:

npm run build

License

Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.

Licensed under the terms of MIT license.

For full details about the license, please check the LICENSE.md file.

The boar used in the project illustration is designed by xylia from Pngtree.com.

Keywords