All Projects → assisfery → CopyPasteJS

assisfery / CopyPasteJS

Licence: other
This a small JS library to execute clipboard functions in a fast and easy way.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to CopyPasteJS

CLIp
CLIp is a clipboard manager for a command line interface written in 100% standard C only. Pipe to it to copy, pipe from it to paste.
Stars: ✭ 12 (-40%)
Mutual labels:  clipboard, copy-paste
copy-image-clipboard
Lightweight library to copy PNG and JPG images to clipboard
Stars: ✭ 37 (+85%)
Mutual labels:  clipboard, copy-to-clipboard
pb
📋 Access HTML and other pasteboards from JS and command line
Stars: ✭ 31 (+55%)
Mutual labels:  clipboard, copy-paste
clipper
📋 Cross Platform Desktop App to Save history of all information you copy and use them whenever with a solitary snap
Stars: ✭ 42 (+110%)
Mutual labels:  clipboard, copy-to-clipboard
react-hook-clipboard
A React hook for accessing clipboard
Stars: ✭ 16 (-20%)
Mutual labels:  clipboard, copy-to-clipboard
Tmux Yank
Tmux plugin for copying to system clipboard. Works on OSX, Linux and Cygwin.
Stars: ✭ 1,941 (+9605%)
Mutual labels:  clipboard
Vue Clipboards
📋 Vue2.0 directive to copy or cut text to clipboard.
Stars: ✭ 200 (+900%)
Mutual labels:  clipboard
Use Clippy
React Hook for reading from and writing to the user's clipboard.
Stars: ✭ 139 (+595%)
Mutual labels:  clipboard
Feedback
Feedback & wiki for Snipaste https://snipaste.com
Stars: ✭ 1,863 (+9215%)
Mutual labels:  clipboard
Vscode Paste Image
paste image from clipboard to markdown/asciidoc directly!
Stars: ✭ 236 (+1080%)
Mutual labels:  clipboard
Windows User Action Hook
A .NET library to subscribe for Windows operating system global user actions such mouse, keyboard, clipboard & print events
Stars: ✭ 224 (+1020%)
Mutual labels:  clipboard
Piknik
Copy/paste anything over the network.
Stars: ✭ 2,221 (+11005%)
Mutual labels:  clipboard
React Use Clipboard
React hook that provides copy to clipboard functionality.
Stars: ✭ 149 (+645%)
Mutual labels:  clipboard
Clipboardy
Chrome extension for copying posted code to clipboard from stackoverflow.com, github.com & npmjs.com
Stars: ✭ 202 (+910%)
Mutual labels:  clipboard
Xcv
✂️ Cut, Copy and Paste files with Bash
Stars: ✭ 144 (+620%)
Mutual labels:  clipboard
Vim Yoink
Vim plugin that maintains a yank history to cycle between when pasting
Stars: ✭ 225 (+1025%)
Mutual labels:  clipboard
Lazyhub
lazyhub - Terminal UI Client for GitHub using gocui.
Stars: ✭ 133 (+565%)
Mutual labels:  clipboard
Zsh Vi Mode
💻 A better and friendly vi(vim) mode plugin for ZSH.
Stars: ✭ 181 (+805%)
Mutual labels:  clipboard
Devcomrade
DevComrade - A copy/paste/run productivity improvement utility for developers
Stars: ✭ 206 (+930%)
Mutual labels:  clipboard
Clipman
A simple clipboard manager for Wayland
Stars: ✭ 182 (+810%)
Mutual labels:  clipboard

CopyPasteJS

This a small JS library to execute clipboard functions in a fast and easy way.

Demo

See the demo here: https://assisfery.github.io/CopyPasteJS/index.html

Repositorys

Github repository: https://github.com/assisfery/CopyPasteJS

CDN repository: https://www.jsdelivr.com/package/gh/assisfery/CopyPasteJS

NPM repository: https://www.npmjs.com/package/copypastejs

Get Start

Just import the src/CopyPasteJS.js file in your document.

<script src="src/CopyPasteJS.js"></script>

This file is hosted in CDN JSDelivr.

<script src="https://cdn.jsdelivr.net/gh/assisfery/[email protected]/src/CopyPasteJS.min.js"></script>

Or you can get it using NPM repository.

npm i copypastejs

Copy Text - From Input Element

To copy data from a input element just add data-copy-origin="#element" attribute to the button.

<button class="btn btn-success" data-copy-origin="#txtCopy">Copy</button>

Copy Text - From Nowhere

To copy text to clipboard data-copy-text="text" attribute to the button.

<button class="btn btn-success" data-copy-text="Some text">Copy</button>

Copy Text - From Others Element

To copy text to clipboard from a html element just include data-copy-text="text" attribute to the button.

<button class="btn btn-success" data-copy-origin="#element">Copy</button>

Paste Text

To paste data to a input element just add data-paste-target="#element" attribute to the button.

<button class="btn btn-success" data-paste-target="#txtPaste">Paste</button>

Cut Text

To cut data from a input element just add data-cut-origin="#element" attribute to the button.

<button class="btn btn-success" data-cut-origin="#txtCut">Cut</button>

Copy and Paste Text

To copy and paste data from a input element to another just add data-copy-origin="#element" and data-paste-target="#element" attributes to the button.

<button class="btn btn-success"
data-copy-origin="#txtCopy2"
data-paste-target="#txtPaste2">Copy and Paste</button>

Copy Callback function

After data is been copied if you want to execute a function just add data-copy-callback="jscode()" attribute to the button.

<button class="btn btn-success" data-copy-origin="#txtCopy3" data-copy-callback="alert('copied')">Copy and Callback</button>

Paste Callback function

After data is been pasted if you want to execute a function just add data-paste-callback="jscode()" attribute to the button.

<button class="btn btn-success" data-paste-target="#txtPaste3" data-paste-callback="alert('pasted')">Paste and Callback</button>

JavaScript Utils

You can do all those actions in JavaScript code.

Copy Text in JavaScript

CopyPasteJS.copyText("Text copied in JS");

Copy Text in JavaScript and Callback Function

CopyPasteJS.copyText("Text copied in JS and Callback triggered", function(){
	alert("Yes its done");
});

Copy Value From Element in JavaScript

CopyPasteJS.copyFrom("#txtCopy4");

// OR USE CALLBACK
CopyPasteJS.copyFrom("#txtCopy4", function(){
	alert(123);
});

Paste To Element in JavaScript

CopyPasteJS.pasteTo("#txtPaste4");

// OR CALL A FUNCTION
CopyPasteJS.pasteTo("#txtPaste4", function(){
	alert("I fell amazing");
});
Cut Value From Element in JavaScript
CopyPasteJS.cutFrom("#txtCut2");

// OR CALL A FUNCTION
CopyPasteJS.cutFrom("#txtCut2", function(){
	alert("I fell amazing");
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].