1、下载附件,将ZeroClipboard.js和ZeroClipboard.swf放在同一目录。
2、该功能需放在容器中运行才能生效。
2、该功能需放在容器中运行才能生效。
<script type="text/javascript" src="/includes/js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="/includes/js/ZeroClipboard.js"></script>
<script language="JavaScript">
var clipComment = null;
$(function(){
clipComment = new ZeroClipboard.Client();
clipComment.setHandCursor( true );
clipComment.addEventListener('mouseOver', my_mouse_over_comment);
clipComment.addEventListener('complete', my_complete_comment);
clipComment.glue( 'd_clip_button_comment' );
});
function my_mouse_over_comment(client) {
// we can cheat a little here -- update the text on mouse over
clipComment.setText( $('#copySvnComment').val() );
}
function my_complete_comment(client, text) {
commentMark.innerHTML=" Copy successfully!";
}
$(window).resize(function(){
clipComment.reposition();
});
</script>
#if ($value)
<span id="svnComment">$value.toString()</span>
<input id = "copySvnComment" type="hidden" value="$value.toString()" />
<input id="d_clip_button_comment" type="button" value="copy" />
<span id="commentMark"></span>
#end