PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 4.2.4
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v4.2.4
4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / assets / pdf-flip-book / viewer.html
embedpress / assets / pdf-flip-book Last commit date
css 2 years ago images 2 years ago js 1 year ago sounds 2 years ago templates 2 years ago viewer.html 1 year ago
viewer.html
132 lines
1 <!DOCTYPE html>
2 <html>
3
4 <head>
5 <title>Debugging</title>
6 <meta charset="utf-8" />
7 </head>
8
9 <body>
10 <style type="text/css">
11 body {
12 margin: 0;
13 padding: 0;
14 }
15
16 .viewer-container {
17 height: 100vh;
18 width: 100%;
19 overflow: hidden;
20 }
21
22 .fullscreen {
23 background-color: #333;
24 }
25 </style>
26
27 <div class="viewer-container" id="viewer-container"></div>
28
29 <script src="../../../../../wp-includes/js/jquery/jquery.js"></script>
30 <script src="js/html2canvas.min.js"></script>
31 <script src="js/three.min.js"></script>
32 <script src="js/pdf.min.js"></script>
33 <script src="js/3dflipbook.min.js"></script>
34
35 <script type="text/javascript">
36 var template = {
37 html: "templates/book-view.html",
38 links: [],
39 styles: ["css/ep-black-book-view.css"],
40 script: "js/default-book-view.js",
41 sounds: {
42 startFlip: "sounds/start-flip.mp3",
43 endFlip: "sounds/end-flip.mp3",
44 },
45 };
46 </script>
47
48 <script>
49 // Ensure the script runs after the page has fully loaded
50
51 // Function to extract the file URL from the query parameters
52 function extractFileParamData(src, $param) {
53 // Parse the URL
54 var url = new URL(src);
55 // Extract the 'file' parameter from the query string
56 var fileUrl = url.searchParams.get($param);
57 return fileUrl;
58 }
59
60 var parentIframeSrc;
61
62 var params = {};
63
64 window.onload = function () {
65 // Access the parent window
66 var parentWindow = window.parent;
67
68 // Get the iframes within the parent window
69 var iframes = parentWindow.document.getElementsByTagName("iframe");
70
71 for (var i = 0; i < iframes.length; i++) {
72 if (iframes[i].contentWindow === window) {
73 // Get the src attribute of the iframe
74 parentIframeSrc = iframes[i].src;
75
76 // Book 1 {
77 jQuery("#viewer-container").FlipBook({
78 pdf: extractFileParamData(parentIframeSrc, "file"),
79 template: template,
80 });
81
82 // The encoded string you want to decode
83 const encodedString = extractFileParamData(parentIframeSrc, "key");
84
85 // Step 1: Base64 Decode
86 const decodedString = atob(encodedString);
87
88 // Step 1: Create URLSearchParams object
89 const urlParams = new URLSearchParams(decodedString);
90
91 // Step 2: Convert URLSearchParams to Object
92 const paramsObject = {};
93 for (const [key, value] of urlParams.entries()) {
94 params[key] =
95 value == "yes" || value == "true"
96 ? true
97 : value == "no"
98 ? false
99 : value;
100 }
101
102
103 const newSettings = decodedString;
104
105 let oldData = localStorage.getItem("flipbook_settings");
106 let settingsArray;
107
108 try {
109 settingsArray = oldData ? JSON.parse(oldData) : [];
110 if (!Array.isArray(settingsArray)) {
111 settingsArray = [];
112 }
113 } catch (e) {
114 settingsArray = [];
115 }
116
117 settingsArray.push(newSettings);
118
119 let newData = JSON.stringify(settingsArray);
120 localStorage.setItem("flipbook_settings", newData);
121
122 let updatedData = localStorage.getItem("flipbook_settings");
123
124
125 break; // Exit the loop once the matching iframe is found and processed
126 }
127 }
128 };
129 </script>
130 </body>
131
132 </html>