PluginProbe
Document Embedder – let visitors read files without downloading / 2.1.2
Document Embedder – let visitors read files without downloading v2.1.2
2.3.1 2.3.0 2.2.1 2.2.0 2.1.2 2.1.1 trunk 1.0 1.1 1.2 1.3 1.7.4 1.7.6 1.7.9 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 2.0.0 2.0.1 2.0.2 All 30 releases
document-emberdder / assets / js / script.js

script.js in Document Embedder – let visitors read files without downloading 2.1.2, at assets/js/script.js

60 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function ($) {
2 $(document).ready(function () {
3
4 // import data
5 $(document).on("click", ".ppv_import_data", function (e) {
6 e.preventDefault();
7 $.ajax({
8 url: ppvAdmin.ajaxUrl,
9 data: {
10 action: "ppv_import_data",
11 },
12 success: function (data) {
13 const result = JSON.parse(data);
14 if (result.success === true) {
15 location.href = location.href + "?ppv-import=success";
16 }
17 },
18 });
19 });
20
21 // copy to clipboard
22 $(".bplde_front_shortcode input").on("click", function (e) {
23 e.preventDefault();
24
25 let shortcode = $(this).parent().find("input")[0];
26 shortcode.select();
27 shortcode.setSelectionRange(0, 30);
28 document.execCommand("copy");
29 $(this).parent().find(".htooltip").text("Copied Successfully!");
30 });
31
32 $(".bplde_front_shortcode input").on("mouseout", function () {
33 $(this).parent().find(".htooltip").text("Copy To Clipboard");
34 });
35
36
37 $(document).on("click", ".pdfp_shortcode_copy_btn", function (e) {
38 e.preventDefault();
39
40 const text = $(this).data("clipboard-text");
41 if (navigator.clipboard) {
42 navigator.clipboard.writeText(text);
43 } else {
44 const tempInput = document.createElement("input");
45 tempInput.value = text;
46 document.body.appendChild(tempInput);
47 tempInput.select();
48 document.execCommand("copy");
49 document.body.removeChild(tempInput);
50 }
51 $(this).text("Copied!");
52 setTimeout(() => {
53 $(this).text("Copy Shortcode");
54 }, 2000);
55 });
56
57
58 });
59 })(jQuery);
60