Coder Social home page Coder Social logo

jquery-zclip's Introduction

jquery-zclip

jQuery ZeroClipboard

Copyright 2011, SteamDev

Originally forked from: http://steamdev.com/zclip

Released under the MIT license, see LICENSE.

Usage

jQuery({selector}).zclip({options});
  • selector: any valid jquery object selector
  • options: Object, see section below.

Options

Option Default value Description
path 'ZeroClipboard.swf' The path to ZeroClipboard.swf
copy null String to copy or function that returns a string to copy
afterCopy null Function to execute after copying
beforeCopy null Function to execute before copying
clickAfter true Relay a click event to the element bound to after copying
setHandCursor true Set the cursor to pointer
setCSSEffects true Add hover and active classes to the element bound to

NOTE: Since v1.1.5, default options can be set globally by setting the value of ZeroclipBoard.defaults.{option}.

jquery-zclip's People

Contributors

adambullmer avatar patricklodder avatar sorribas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery-zclip's Issues

Zclip Not working

I have this settings:

var element = '.copyLink',
    path = '/-js/libs/jquery/ZeroClipboard.swf';


$(element).zclip({
            path: path,         
            copy: function() {
                return $(this).find('.copy-text').text();
            },
            beforeCopy: function () {
                console.log('test');
            },
            afterCopy: function() {
                console.log('good');
            }
        });

this initialize when document is ready but not working, greetings!

The first click is invalid after refreshing the page

The first click is invalid after refreshing the page.The second and subsequent clicks can copy content.

$("#export_url").zclip({
path: '../../js/zclip/ZeroClipboard.swf',
copy: function(){
return ElasticSchema.queryLink;
},
beforeCopy: function(){
},
afterCopy: function(){
console.log("zclip success ExportLink");
}
});

Zclip doesn't work in Webkit-based Browser

When I use Chrome Android mobile device to test Zclip, it does not work.
But when I try it in PC environment (same code), it works well.
Guess it does not work in Android browser

not working on https

Hi,

I have tried to integrade it, its working fine on my local but when i updated it on https its not working.

Thanks

Formatted text cannot be copy and paste.

The zclip plugin for copying text to clipboard works fine for plain text but not for formatted text.

I am having div with html as

<div id="formattedDiv">
  <b>Copied Text </b>
</div>

and when I apply zclip on some button to copy formmattedDiv text as

$("a#copyCustombtn").on('click', function (e) {
e.preventDefault();
}).zclip({
path: 'http://www.steamdev.com/zclip/js/ZeroClipboard.swf',
copy: function () {
return $("#formattedDiv").html()
}
});
It copies entire html as <b>Copied Text </b>

When I try to paste, it pastes exactly <b>Copied Text </b>

but not formatted text as "Copied Text " - (in bold form)

Events do not register when compiled with RequireJS

The Flash movie is dependent on global var "ZeroClipboard". However, this var is renamed and placed in a closure when minified with RequireJS.

This can be fixed simply by changing "var ZeroClipboard" to "ZeroClipboard".

Line breaks

Hi there, great information which has helped me get up and running. I'm wondering if you've had any luck preserving line breaks when copying a large div?

I have an instance where a div contains many called variables, each contained inside a span, many of which originate from textareas. I can format the output of said textareas fine using 'replace(/\n/g,'\r\n');' and the div formatting in browser is perfect; but this formatting is then lost when it comes to zclip being called - all variables contained in the divare copied to the clipboard fine, but it's all pasted across a single line. I've tried pasting in RTF processors as well as just Notepad to ensure it's not Windows clipboard being silly.

I've tried integrating a replace for \r\n into the zlip call, but just cannot get it working. I don't suppose you've come across this and managed to tackle it?

Using zclip to copy multiple values with multiple copy buttons?

Strange issue, flash object fails to initialize on all buttons even though zclip is called for each button.

Current code:

$(document).ready(function(){
$('.copylink').each(function(){
$(this).zclip({
path : '/flash/ZeroClipboard.swf',
copy: function(){ return $(this).attr('data-copy-shorturl'); },
afterCopy: function()
{
console.log($(this).data('copy-shorturl') + " was copied to clipboard");
}
});
});
});

Example of the buttons being initialized:

image 2014-08-05 at 6 24 57 am

Currently only the first button on the page actually copies it's value to clipboard, any thoughts on what could be the issue? I'm sure whether or not this is simply a coding issue on my behalf or a genuine bug. Thank you.

Copy-section moves away from target

When zclip is implemented on a i.e. span tag/button/text area, the actual clickable area moves automagically to some random corner/top of the section and even though size is changed, it still stays in the same area with same area-size. Still clickable/functional in that area but completely out of design for the consumer/user. Can this be changed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.