Skip to content

Commit

Permalink
change zeroclipboard to clipboardjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Preovaleo committed Mar 22, 2016
1 parent fe18186 commit 1003a6c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 26 deletions.
3 changes: 1 addition & 2 deletions includes/functions-html.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function yourls_html_head( $context = 'index', $title = '' ) {
<?php if ( $share ) { ?>
<link rel="stylesheet" href="<?php yourls_site_url(); ?>/css/share.css?v=<?php echo YOURLS_VERSION; ?>" type="text/css" media="screen" />
<script src="<?php yourls_site_url(); ?>/js/share.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
<script src="<?php yourls_site_url(); ?>/js/jquery.zclip.min.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
<script src="<?php yourls_site_url(); ?>/js/clipboard.min.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
<?php } ?>
<?php if ( $cal ) { ?>
<link rel="stylesheet" href="<?php yourls_site_url(); ?>/css/cal.css?v=<?php echo YOURLS_VERSION; ?>" type="text/css" media="screen" />
Expand All @@ -123,7 +123,6 @@ function yourls_html_head( $context = 'index', $title = '' ) {
<script type="text/javascript">
//<![CDATA[
var ajaxurl = '<?php echo yourls_admin_url( 'admin-ajax.php' ); ?>';
var zclipurl = '<?php yourls_site_url(); ?>/js/ZeroClipboard.swf';
//]]>
</script>
<?php yourls_do_action( 'html_head', $context ); ?>
Expand Down
Binary file removed js/ZeroClipboard.swf
Binary file not shown.
7 changes: 7 additions & 0 deletions js/clipboard.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions js/jquery.zclip.min.js

This file was deleted.

22 changes: 10 additions & 12 deletions js/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,14 @@ function share(dest) {
}

function init_clipboard() {
$('#copylink').click(function(){
$(this).select();
})

$('#copylink').zclip({
path: zclipurl,
copy: $('#copylink').val(),
afterCopy:function(){
html_pulse( '#copybox h2, #copybox h3', 'Copied!' );
}
});
};

var clipboard = new Clipboard('#copylink', {
text: function (trigger) {
return $(trigger).select();
}
});

clipboard.on('success', function (e) {
html_pulse('#copybox h2, #copybox h3', 'Copied!');
});
};

0 comments on commit 1003a6c

Please sign in to comment.