Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nw跨平台 编辑器粘贴 用例大全 #2

Open
fritx opened this issue Nov 3, 2016 · 1 comment
Open

nw跨平台 编辑器粘贴 用例大全 #2

fritx opened this issue Nov 3, 2016 · 1 comment

Comments

@fritx
Copy link
Owner

fritx commented Nov 3, 2016

Paste to NW.js 0.12.3

Paste from MacOS 10.11 Windows 7
web纯文 html?+text html?+text
web单图 text+image (text为url) html+image
web单图base64 text+image (text为data-url) html+image
web图文 html+text html+text
qq纯文 text html?+text
qq单图 file html+image (image:result为空 ⚠️)
qq图文 text+image (image为其中一张图片 ⚠️) html+text
excel表格 html+text+rtf+image html+text+rtf+image
email图文 html+text+rtf html+text+rtf
桌面图标 text+image (文件名+图标) -
mac备忘录单图 html+image (html为空 text为\uFFFC) -

⚠️ 有些png粘贴后会出现图片花了的情况 应该是webkit本身的bug


Data Expression Value
types e.clipboardData.types ['text/plain'|'text/html'|'Files', ..]
items e.clipboardData.items [{ kind: 'string'|'file', type: 'text/*'|'image/*' }, ..]
html e.clipboardData.getData('text/html') '<html></html>'
text e.clipboardData.getData('text/plain') 'text string'
blob item.getAsFile() <blob>
result reader.readAsBinaryString(blob); reader.onload = e => e.target.result <binary string>

https://zh.wikipedia.org/wiki/RTF
https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer
https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types
https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem

@fritx
Copy link
Owner Author

fritx commented Dec 15, 2016

import Editor from 'react-editor'
import At from 'react-at'
const members = ['Roxie Miles', 'grace.carroll', '小浩']

<At members={members}>
  <Editor />
</At>

@fritx fritx closed this as completed Dec 15, 2016
@fritx fritx reopened this Apr 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant