• Stars
    star
    467
  • Rank 90,795 (Top 2 %)
  • Language
    CoffeeScript
  • License
    MIT License
  • Created over 10 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

read image/text data from clipboard (cross-browser)

paste.js

paste.js is an interface to read data ( text / image ) from clipboard in different browsers. It also contains several hacks.

browser compatibility

IE11 Firefox 33 Chrome 38 Safari(10.1) Opera
pasteText (non-inputable) ok ok ok ok ok
pasteText (textarea) ok ok ok ok ok
pasteText (contenteditable) ok ok ok ok ok
pasteImage (non-inputable) ok ok ok ok ok
pasteImage (textarea) ok ok ok ok ok
pasteImage (contenteditable) ok ok ok ok ok

usage

// jQuery needed
$('.mydiv').pastableNonInputable();

$('textarea').pastableTextarea();

$('div[contenteditable]').pastableContenteditable();

$('*').on('pasteImage', function (ev, data){
  console.log("dataURL: " + data.dataURL);
  console.log("width: " + data.width);
  console.log("height: " + data.height);
  console.log(data.blob);
}).on('pasteImageError', function(ev, data){
  alert('Oops: ' + data.message);
  if(data.url){
    alert('But we got its url anyway:' + data.url)
  }
}).on('pasteText', function (ev, data){
  console.log("text: " + data.text);
});

more

see this example

Thanks BrowserStack for providing cross-browser testing environment for this project.

browserstack_logo

license

The MIT License (MIT)

More Repositories

1

manager-for-upyun

又拍云资源管理器
CoffeeScript
170
star
2

lixian-portal

一个简洁实用的 Web 版迅雷离线下载程序。
JavaScript
133
star
3

gfwlist2routeos

把伟大的GFWLIST转化写进RouterOS
CoffeeScript
55
star
4

sshkeyd

Forget about the ssh keys
CoffeeScript
51
star
5

localhostd

Run and serve your web apps in .test domains on your develop machine.
JavaScript
29
star
6

touchy

touchy可以在一个普通网页上启用几个小功能,便于你在投影仪上演示。
JavaScript
18
star
7

freedom-routes

Internet Freedom - Implement routes for vpn.
Go
16
star
8

node-lixian

非官方迅雷离线下载服务 API for nodejs
CoffeeScript
16
star
9

wqy

wenquanyi (文泉驿) 开源中文字体
Ruby
16
star
10

rails-assets-for-upyun

把预编译好的静态资源发布到又拍云上(`rake`一下)
Ruby
14
star
11

chnroutesapp

不用在本地运行chnroutes,直接在线获取chnroutes脚本
HTML
13
star
12

devhttps

HTTPS proxy for emulating secure connections in development.
CoffeeScript
12
star
13

unchained.coffee

CoffeeScript Unchained!
CoffeeScript
8
star
14

icomoon-bower

icomoon free font as a bower component
CSS
7
star
15

svnpod

xxx, 帮我开个svn账号。
CoffeeScript
5
star
16

myslides

我的幻灯片
JavaScript
4
star
17

node-excel-api

a simple wrapper arround the mature [JExcelApi](http://jexcelapi.sourceforge.net/) project
CoffeeScript
4
star
18

node-tailer

`tail` in browsers at your own risk
CoffeeScript
3
star
19

markem

zero(nearly)-conf static site generator
CSS
3
star
20

git-battlestation

轻便的git伴侣
JavaScript
2
star
21

dotfiles

Michael Yin's dotfiles
Shell
2
star
22

superclusterjs-ruby

Ruby
2
star
23

gitpages

provide 'github pages'-like functionalities for gitlab
CoffeeScript
2
star
24

galeriders

Website of the Gale Riders runners club
JavaScript
2
star
25

myhome

[上海]普陀区上海西站地铁站旁二室一厅月租3000求室友分担
2
star
26

LLife

a series of experiments been done to improve Micheal's college life
C#
1
star
27

jadepacker

pack your jades
1
star
28

pow_index

Guide you from other ports to any of your `pow.io` projects
JavaScript
1
star
29

turfjs-ruby

Turf.js bridge for ruby
Ruby
1
star
30

getaport

Get a random free tcp port.
JavaScript
1
star
31

gfwlist2ip.js

把伟大的GFWLIST转化成IP列表
CoffeeScript
1
star
32

michaelhost

Michael Yin's very own hosting software (I can't believe he's using that thingy to host all his stuff)
JavaScript
1
star
33

HMM-experiments

a series experiments with HMM on image-processing
C#
1
star
34

jquery-ui.daterange

modified version of jquery-ui.datepicker with range support
JavaScript
1
star
35

omniauth-tiktok-loginkit

OmniAuth Strategy for TikTok LoginKit
Ruby
1
star
36

express-sexy-static

sexy static content server for express
JavaScript
1
star