/** * Simple text copy functions using native browser clipboard capabilities. * @since 1.4.3 */ jQuery(function ($) { var URCopyShortcode = { /** * Initiate copy shortcode process. */ init: function () { $(".ur-copy-shortcode").each(function () { var $this = $(this); $this.on("click", function (evt) { var res = $this.parent().find(".code").val(); URCopyShortcode.urSetClipboard(res, $this); $this .tooltipster( 'content', $( this ).attr( 'data-copied' ) ) .trigger( 'focus' ) .on( 'mouseleave', function() { var $this = $( this ); setTimeout( function() { $this.tooltipster( 'content', $this.attr( 'data-tip' ) ); }, 1000 ); } ); evt.preventDefault(); }); }); }, /** * Set the user's clipboard contents. * * @param string data: Text to copy to clipboard. * @param object $el: jQuery element to trigger copy events on. (Default: document) */ urSetClipboard: function (data, $el) { if ("undefined" === typeof $el) { $el = jQuery(document); } var $temp_input = jQuery('<textarea style="opacity:0">'); jQuery("body").append($temp_input); $temp_input.val(data).select(); $el.trigger("beforecopy"); try { document.execCommand("copy"); $el.trigger("aftercopy"); } catch (err) { $el.trigger("aftercopyfailure"); } $temp_input.remove(); }, /** * Clear the user's clipboard. */ urClearClipboard: function () { URCopyShortcode.urSetClipboard(""); }, }; /** * Initiate copy shortcode process. */ URCopyShortcode.init(); });
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
gutenberg | Folder | 0755 |
|
|
admin.js | File | 43.35 KB | 0644 |
|
admin.min.js | File | 26.38 KB | 0644 |
|
backbone-modal.js | File | 3.38 KB | 0644 |
|
backbone-modal.min.js | File | 2.13 KB | 0644 |
|
dashboard-widget.js | File | 1.57 KB | 0644 |
|
dashboard-widget.min.js | File | 1.25 KB | 0644 |
|
deactivation-feedback.js | File | 2.58 KB | 0644 |
|
deactivation-feedback.min.js | File | 1.72 KB | 0644 |
|
enhanced-select.js | File | 6.33 KB | 0644 |
|
enhanced-select.min.js | File | 3.3 KB | 0644 |
|
form-builder.js | File | 197.05 KB | 0644 |
|
form-builder.min.js | File | 92.8 KB | 0644 |
|
form-modal.js | File | 2.77 KB | 0644 |
|
form-modal.min.js | File | 1.58 KB | 0644 |
|
form-settings.js | File | 2.92 KB | 0644 |
|
form-settings.min.js | File | 1.97 KB | 0644 |
|
form-templates.js | File | 705 B | 0644 |
|
form-templates.min.js | File | 498 B | 0644 |
|
live-user-notice.js | File | 2.16 KB | 0644 |
|
live-user-notice.min.js | File | 1.41 KB | 0644 |
|
settings.js | File | 27.92 KB | 0644 |
|
settings.min.js | File | 17.53 KB | 0644 |
|
shortcode-form-embed.js | File | 1.86 KB | 0644 |
|
shortcode-form-embed.min.js | File | 1.1 KB | 0644 |
|
ur-copy.js | File | 1.57 KB | 0644 |
|
ur-copy.min.js | File | 732 B | 0644 |
|
ur-notice.js | File | 995 B | 0644 |
|
ur-notice.min.js | File | 584 B | 0644 |
|
ur-setup.js | File | 29.67 KB | 0644 |
|
ur-setup.min.js | File | 16.98 KB | 0644 |
|