0.1.2 • Published 5 years ago

clipboar v0.1.2

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

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.