| Server IP : 167.99.224.18 / Your IP : 216.73.216.136 Web Server : Apache/2.4.41 (Ubuntu) System : Linux wordpress-ubuntu-s-1vcpu-1gb-nyc1-01 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.0.25 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/wp-content/plugins-old/duplicator/assets/js/ |
Upload File : |
/*! dup tooltip */
(function ($) {
DuplicatorTooltip = {
initialized: false,
messages: {
'copy': window.hasOwnProperty('l10nDupTooltip') ? l10nDupTooltip.copy : 'Copy to clipboard',
'copied': window.hasOwnProperty('l10nDupTooltip') ? l10nDupTooltip.copied : 'copied to clipboard',
'copyUnable': window.hasOwnProperty('l10nDupTooltip') ? l10nDupTooltip.copyUnable : 'Unable to copy'
},
messages: Object.assign(
{},
{
'copy': 'Copy to Clipboard',
'copied': 'Copied to Clipboard',
'copyUnable': 'Unable to Copy'
},
(typeof l10nDupTooltip === 'object' ? l10nDupTooltip : {})
),
load: function () {
if (this.initialized) {
return;
}
this.loadSelector('[data-tooltip]');
this.loadCopySelector('[data-dup-copy-value]');
this.initialized = true;
},
loadSelector: function (selector) {
$(selector).each(function () {
if (this._tippy) {
// already init
return;
}
tippy(this, {
content: function (ref) {
var header = ref.dataset.tooltipTitle;
var body = ref.dataset.tooltip;
var res = header !== undefined ? '<h3>' + header + '</h3>' : '';
res += '<div class="dup-tippy-content">' + body + '</div>';
return res;
},
allowHTML: true,
interactive: true,
placement: this.dataset.tooltipPlacement ? this.dataset.tooltipPlacement : 'bottom-start',
theme: 'duplicator',
zIndex: 900000,
appendTo: document.body
});
$(this).data('dup-tooltip-loaded', true);
});
},
loadCopySelector: function (selector) {
$(selector).each(function () {
if (this._tippy) {
// already init
return;
}
var element = $(this);
if (element.hasClass('disabled')) {
return;
}
var tippyElement = tippy(this, {
allowHTML: true,
placement: this.dataset.tooltipPlacement ? this.dataset.tooltipPlacement : 'bottom-start',
theme: 'duplicator',
zIndex: 900000,
hideOnClick: false,
trigger: 'manual'
});
var copyTitle = element.is('[data-dup-copy-title]') ? element.data('dup-copy-title') : DuplicatorTooltip.messages.copy;
tippyElement.setContent('<div class="dup-tippy-content">' + copyTitle + '</div>');
//Have to set manually otherwise might hide on click.
element.mouseover(function () {
tippyElement.show();
}).mouseout(function () {
tippyElement.hide();
});
element.click(function () {
var valueToCopy = element.data('dup-copy-value');
var copiedTitle = element.is('[data-dup-copied-title]') ? element.data('dup-copied-title') : valueToCopy + ' ' + DuplicatorTooltip.messages.copied;
var message = DuplicatorTooltip.messages.copyUnable;
var tmpArea = jQuery("<textarea></textarea>").css({
position: 'absolute',
top: '-10000px'
}).text(valueToCopy).appendTo("body");
tmpArea.select();
try {
message = document.execCommand('copy') ? copiedTitle : DuplicatorTooltip.messages.copyUnable;
} catch (err) {
console.log(err);
}
tippyElement.setContent('<div class="dup-tippy-content">' + message + '</div>');
tippyElement.setProps({ theme: 'duplicator-filled' });
setTimeout(function () {
tippyElement.setContent('<div class="dup-tippy-content">' + copyTitle + '</div>');
tippyElement.setProps({ theme: 'duplicator' });
}, 2000);
});
});
},
updateElementContent: function (selector, content) {
if ($(selector).get(0)) {
$(selector).get(0)._tippy.setContent('<div class="dup-tippy-content">' + content + '</div>');
}
},
unload: function () {
var tooltips = document.querySelectorAll('[data-tooltip], [data-dup-copy-value]');
tooltips.forEach(function (element) {
if (element._tippy) {
element._tippy.destroy();
element._tippy = null;
}
});
this.initialized = false;
},
reload: function () {
this.unload();
this.load();
}
}
})(jQuery);