
Security News
Oxlint Introduces Type-Aware Linting Preview
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
I added this wrapper to give access to the zclip Jquery plugin. Nevertheless I can not recommend Zclip. A better solution is to use the zeroclipboard-rails.
Adds easy copytoclipboard functionality to your html-elements this is done by including the Jquery zClip libary to Rails 3.x.
Add this line to your application's Gemfile:
gem 'zclip-rails'
And then execute:
$ bundle
Add this line to your application.js:
//= require zclip
Add an element (button, input, div, span etc.) somewhere in your .erb template e.g.:
<button type="button" id="copy-some-txt">example</button>
Add this in some required js file of your app:
$('#copy-some-txt').zclip({
copy: "this is the text to copy"
});
$('#copy-some-txt').zclip({
copy: "this is the text to copy",
beforeCopy: function() {
alert("I am going to copy some text to your clipboard");
},
afterCopy: function() {
alert("done");
}
});
Settings | ||
---|---|---|
Variable |
Default Value |
Available Values |
copy * | null | any string, or any javascript expression or function that returns a string |
afterCopy | null | specify a function to call after text is copied. (your afterCopy function will overwrite the default alert box.) |
beforeCopy | null | specify a function to call before text is copied. |
clickAfter | true | true false |
setHandCursor | true | true false |
setCSSEffects | true | true false |
* required |
zClip is a flash overlay, so it must provide the target element with "hover" and "active" classes to simulate native :hover and :active states. Be sure to write your CSS as follows for best results:
a:hover, a.hover {...}
a:active, a.active {...}
$('a.copy').zclip('show'); // enable zClip on the selected element
$('a.copy').zclip('hide'); // hide zClip on the selected element
$('a.copy').zclip('remove'); // remove zClip from the selected element
The Zero Clipboard Library has been tested on the following browsers / platforms:
Browser | Windows XP SP3 | Windows Vista | Mac OS X Leopard |
Internet Exploder | 7.0 | 7.0 | - |
Firefox | 3.0 | 3.0 | 3.0 |
Safari | - | - | 3.0 |
Google Chrome | 1.0 | 1.0 | - |
Adobe Flash Flash Player versions 9 and 10 are supported.
Thanks to Joseph Huckaby for writing the zeroclipboard libary.
Thanks to steamdev.com for writing the jQuery wrapper.
Thanks to all the contributers to this Project.
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that zclip-rails demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.