PageSourceSearch

https://brutparty.com/wp-content/cache/min/1/wp-content/themes/bru…/assets/js/copy_on_click.js?ver=1790195781

js brutparty.com collected 2026-09-24 20:04:08 UTC 2,304 bytes, 3 lines download raw bytes

1jQuery(document).ready(function($){$.fn.copyOnClick=function(options){var opts=$.extend({},$.fn.copyOnClick.defaults,options);var that=this.filter('['+opts.attrData+']');that.off('click.copyOnClick touchend').on('click.copyOnClick touchend',function(e){e.preventDefault();e.stopPropagation();var target=$(this).attr(opts.attrData);var textToCopy=target||"";if(!textToCopy){console.warn('No text to copy found');return}
2$.fn.copyOnClick.copyText(textToCopy).then(function(){if(typeof swal!=='undefined'){swal({title:"Link copied!",text:"Link copied successfully",icon:"success",className:'sweet-box-link-copy',buttons:!1,timer:2000,})}else{alert('Link copied!')}}).catch(function(err){console.error('Failed to copy:',err);if(typeof swal!=='undefined'){swal({title:"Error",text:"Failed to copy link. Please try again.",icon:"error",button:"OK"})}else{alert('Failed to copy link. Please try again.')}})});return this};$.fn.copyOnClick.defaults={attrData:"data-copy-on-click",triggerOn:"click.copyOnClick",};$.fn.copyOnClick.copyText=function(text){if(navigator.clipboard&&window.isSecureContext){return navigator.clipboard.writeText(text)}else{return new Promise(function(resolve,reject){try{var $temp=$("<textarea>");$temp.css({position:'fixed',left:'-9999px',top:'-9999px'});$("body").append($temp);$temp.val(text).select();var success=document.execCommand("copy");$temp.remove();if(success){resolve()}else{reject(new Error('execCommand failed'))}}catch(err){reject(err)}})}};function initCopyOnClick(){$('.event-social-link[data-copy-on-click]').each(function(){var $btn=$(this);if(!$btn.data('copyOnClickInitialized')){$btn.off('click.copyOnClick touchend');$btn.copyOnClick();$btn.data('copyOnClickInitialized',!0)}})}
3initCopyOnClick();$(window).on('load',function(){initCopyOnClick()});if(typeof MutationObserver!=='undefined'){var observer=new MutationObserver(function(mutations){var needsInit=!1;mutations.forEach(function(mutation){if(mutation.addedNodes.length){for(var i=0;i<mutation.addedNodes.length;i++){var node=mutation.addedNodes[i];if(node.nodeType===1){if($(node).hasClass('event-social-link')||$(node).find('.event-social-link').length){needsInit=!0;break}}}}});if(needsInit){setTimeout(function(){initCopyOnClick()},100)}});observer.observe(document.body,{childList:!0,subtree:!0})}})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.