Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added visibility detection. Clipboard hides itself when bound object …

…is hidden.
  • Loading branch information...
commit 94dc3bd4a4952512555d0d229d30ff63eabcbece 1 parent 510ddb8
@dudeami authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 scripts/zeroclipboard.jquery.min.js
View
4 scripts/zeroclipboard.jquery.min.js
@@ -1,9 +1,9 @@
-var ZeroClipboard={moviepath:'http://localhost/jquery.zeroclipboard/scripts/ZeroClipboard.swf',objects:[],pairs:{},dispatch:function(id,eventName,args){var eventName=eventName.toString().toLowerCase().replace(/^on/,'');switch(eventName){case'load':var movie=document.getElementById('zeroclipboard_swf_'+id);if(!movie){setTimeout(function(){ZeroClipboard.dispatch(id,'load',null);},1);return;}
+var ZeroClipboard={moviepath:'scripts/ZeroClipboard/ZeroClipboard.swf',objects:[],pairs:{},dispatch:function(id,eventName,args){var eventName=eventName.toString().toLowerCase().replace(/^on/,'');switch(eventName){case'load':var movie=document.getElementById('zeroclipboard_swf_'+id);if(!movie){setTimeout(function(){ZeroClipboard.dispatch(id,'load',null);},1);return;}
if(!$(ZeroClipboard.pairs[id]).data("zeroclipboard_ready")&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){setTimeout(function(){ZeroClipboard.dispatch(id,'load',null);},100);$(this.pairs[id]).data("zeroclipboard_ready",true);return;}
$(this.pairs[id]).data("zeroclipboard_ready",true);ZeroClipboard.update(id);break;case'complete':break;case'mouseover':$(this.pairs[id]).trigger('mouseover');break;case'mouseout':$(this.pairs[id]).trigger('mouseout');if($(this.pairs[id]).data('zeroclipboard_downfix')){$(this.pairs[id]).trigger('mouseup');}
break;case'mouseup':$(this.pairs[id]).trigger('mouseup');$(this.pairs[id]).data('zeroclipboard_downfix',false);break;case'mousedown':$(this.pairs[id]).data('zeroclipboard_downfix',true);$(this.pairs[id]).trigger('mousedown');break;}},update:function(id){var original=this.pairs[id];if($(original).data("zeroclipboard_ready")){var flash=document.getElementById('zeroclipboard_swf_'+id);if($(original).data('zeroclipboard_resize')){var elemWidth=$(original).outerWidth();var elemHeight=$(original).outerHeight();var elemPos=$(original).offset();$(flash).attr('width',elemWidth).attr('height',elemHeight);$(flash).parent().css({'width':elemWidth+'px','height':elemHeight+'px','top':elemPos.top,'left':elemPos.left});$(original).data('zeroclipboard_resize',false);}
-flash.setText($(original).data('zeroclipboard_text'));flash.setHandCursor($(original).data('zeroclipboard_hand'));}else{}}};(function($){(function(){var ev=new $.Event('remove'),orig=$.fn.remove;$.fn.remove=function(){$(this).trigger(ev);orig.apply(this,arguments);}})();$(window).resize(function(){$.each(ZeroClipboard.pairs,function(id,contents){if(contents==null)return;$(contents).data('zeroclipboard_resize',true);ZeroClipboard.update(id);});});$("*").bind('remove',function(){$(window).resize();});$.fn.zeroclipboarduid=function(fnoptions){if($(this).length<1)return;var options={'prefix':'','length':8,'chars':"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"};if(typeof fnoptions!="undefined"){$.extend(options,fnoptions);}
+flash.setText($(original).data('zeroclipboard_text'));flash.setHandCursor($(original).data('zeroclipboard_hand'));}else{}}};(function($){(function(){var ev=new $.Event('remove'),orig=$.fn.remove;$.fn.remove=function(){$(this).trigger(ev);orig.apply(this,arguments);}})();setInterval(function(){$.each(ZeroClipboard.pairs,function(id,contents){$('#zeroclipboard_swf_'+id).parent().css('display',$(contents).is(':visible')?'block':'none');});},250);$(window).resize(function(){$.each(ZeroClipboard.pairs,function(id,contents){if(contents==null)return;$(contents).data('zeroclipboard_resize',true);ZeroClipboard.update(id);});});$("*").bind('remove',function(){$(window).resize();});$.fn.zeroclipboarduid=function(fnoptions){if($(this).length<1)return;var options={'prefix':'','length':8,'chars':"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"};if(typeof fnoptions!="undefined"){$.extend(options,fnoptions);}
if(typeof prefix=="undefined"){prefix="";}
return this.each(function(){if($(this).attr('id')!='')return $;var retrn='';var id='#';do{retrn='';var first=true;for(var i=0;i<options.length;i++){var rnum=Math.floor(Math.random()*options.chars.length);retrn+=options.chars.substring(rnum,rnum+1);}
id='#'+retrn;}while($('#'+retrn).length>0||retrn.match(/^[A-Za-z].*/)!=retrn);$(this).attr('id',retrn);return $;});}
Please sign in to comment.
Something went wrong with that request. Please try again.