| 1 |
(function (window, document, $) { |
| 2 |
"use strict"; |
| 3 |
var ElementPackLiveCopy = { |
| 4 |
//Initializing properties and methods |
| 5 |
init: function (e) { |
| 6 |
ElementPackLiveCopy.loadContextMenuGroupsHooks(); |
| 7 |
}, |
| 8 |
loadContextMenuGroupsHooks: function () { |
| 9 |
elementor.hooks.addFilter( |
| 10 |
"elements/container/contextMenuGroups", |
| 11 |
function (groups, element) { |
| 12 |
return ElementPackLiveCopy.prepareMenuItem(groups, element); |
| 13 |
} |
| 14 |
); |
| 15 |
|
| 16 |
elementor.hooks.addFilter( |
| 17 |
"elements/section/contextMenuGroups", |
| 18 |
function (groups, element) { |
| 19 |
return ElementPackLiveCopy.prepareMenuItem(groups, element); |
| 20 |
} |
| 21 |
); |
| 22 |
|
| 23 |
elementor.hooks.addFilter( |
| 24 |
"elements/widget/contextMenuGroups", |
| 25 |
function (groups, element) { |
| 26 |
return ElementPackLiveCopy.prepareMenuItem(groups, element); |
| 27 |
} |
| 28 |
); |
| 29 |
|
| 30 |
elementor.hooks.addFilter( |
| 31 |
"elements/column/contextMenuGroups", |
| 32 |
function (groups, element) { |
| 33 |
return ElementPackLiveCopy.prepareMenuItem(groups, element); |
| 34 |
} |
| 35 |
); |
| 36 |
}, |
| 37 |
prepareMenuItem: function (groups, element) { |
| 38 |
var index = _.findIndex(groups, function (element) { |
| 39 |
return "clipboard" === element.name; |
| 40 |
}); |
| 41 |
groups.splice(index + 1, 0, { |
| 42 |
name: "bdt-ep-live-copy-paste", |
| 43 |
actions: [ |
| 44 |
{ |
| 45 |
name: "ep-live-copy", |
| 46 |
title: "Live Copy", |
| 47 |
icon: "bdt-wi-element-pack", |
| 48 |
callback: function () { |
| 49 |
alert( |
| 50 |
"Oops! The 'Live Copy' button has been deprecated. You can now use Elementor's built-in 'Copy' feature instead. Enjoy the improved functionality!" |
| 51 |
); |
| 52 |
}, |
| 53 |
}, |
| 54 |
{ |
| 55 |
name: "ep-live-paste", |
| 56 |
title: "Live Paste", |
| 57 |
icon: "bdt-wi-element-pack", |
| 58 |
callback: function () { |
| 59 |
alert( |
| 60 |
"Oops! The 'Live Paste' button has been deprecated. You can now use Elementor's built-in 'Paste from other site' feature instead. Enjoy the improved functionality!" |
| 61 |
); |
| 62 |
}, |
| 63 |
}, |
| 64 |
], |
| 65 |
}); |
| 66 |
|
| 67 |
return groups; |
| 68 |
}, |
| 69 |
}; |
| 70 |
ElementPackLiveCopy.init(); |
| 71 |
})(window, document, jQuery); |
| 72 |
|