huebs/zeroclipboard
Composer 安装命令:
composer require huebs/zeroclipboard
包简介
The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
README 文档
README
WARNING
This master branch contains the v2.x codebase for ZeroClipboard! For the v1.x codebase, see the 1.x-master branch instead.
ZeroClipboard
The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface. The "Zero" signifies that the library is invisible and the user interface is left entirely up to you.
This is achieved by automatically floating the invisible movie on top of a DOM element of your choice. Standard mouse events are even propagated out to your DOM element, so you can still have rollover and mousedown effects.
Limitations
User Interaction Required
Due to browser and Flash security restrictions, this clipboard injection can ONLY occur when
the user clicks on the invisible Flash movie. A simulated click event from JavaScript will not
suffice as this would enable clipboard poisoning.
Other Limitations
For a complete list of limitations, see docs/instructions.md#limitations.
Simple Example
<html> <body> <button id="copy-button" data-clipboard-text="Copy Me!" title="Click to copy me.">Copy to Clipboard</button> <script src="ZeroClipboard.js"></script> <script src="main.js"></script> </body> </html>
// main.js var client = new ZeroClipboard( document.getElementById("copy-button") ); client.on( "ready", function( readyEvent ) { // alert( "ZeroClipboard SWF is ready!" ); client.on( "aftercopy", function( event ) { // `this` === `client` // `event.target` === the element that was clicked event.target.style.display = "none"; alert("Copied text to clipboard: " + event.data["text/plain"] ); } ); } );
See docs/instructions.md for more advanced options in using the library on your site. See docs/api/ZeroClipboard.md for the complete API documentation.
Here is a working test page where you can try out ZeroClipboard in your browser.
Testing ZeroClipboard Locally
To test the page demo page locally, clone the website repo.
Support
This library is fully compatible with Flash Player 11.0.0 and above, which requires that the clipboard copy operation be initiated by a user click event inside the Flash movie. This is achieved by automatically floating the invisible movie on top of a DOM element of your choice. Standard mouse events are even propagated out to your DOM element, so you can still have rollover and mousedown effects with just a little extra effort.
ZeroClipboard v2.x is expected to work in IE9+ and all of the evergreen browsers.
Although support for IE7 & IE8 was officially dropped in v2.0.0, it was actually
still technically supported through v2.0.2.
Contributing
see CONTRIBUTING.md
Releases
Starting with version 1.1.7, ZeroClipboard uses semantic versioning.
see releases
Roadmap
see roadmap.md
huebs/zeroclipboard 适用场景与选型建议
huebs/zeroclipboard 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 124 次下载、GitHub Stars 达 0, 最近一次更新时间为 2014 年 12 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「flash」 「copy」 「clipboard」 「cut」 「paste」 「zclip」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 huebs/zeroclipboard 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 huebs/zeroclipboard 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 huebs/zeroclipboard 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Copy files with better control over copying than the default Phing CopyTask
Synchronise two directories.
The InstantConfigurationCopy module provides easy way to copy configuration field information for admin in back office Magento 2.
Clipboard Bundle for Pimcore 5. Adding objects to the special clipboard give you possibility to make actions only on some marked by you objects.
Insert punctuation marks into your text with a single click
Store pages, articles and content elements in long-term clipboard
统计信息
- 总下载量: 124
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-06