PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 4.0.5
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v4.0.5
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 2 years ago sounds 2 years ago templates 2 years ago viewer.html 2 years ago
viewer.html
131 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 }
20
21 .fullscreen {
22 background-color: #333;
23 }
24 </style>
25
26 <div class="viewer-container" id="viewer-container"></div>
27
28 <script src="../../../../../wp-includes/js/jquery/jquery.js"></script>
29 <script src="js/html2canvas.min.js"></script>
30 <script src="js/three.min.js"></script>
31 <script src="js/pdf.min.js"></script>
32 <script src="js/3dflipbook.min.js"></script>
33
34 <script type="text/javascript">
35 var template = {
36 html: "templates/book-view.html",
37 links: [],
38 styles: ["css/ep-black-book-view.css"],
39 script: "js/default-book-view.js",
40 sounds: {
41 startFlip: "sounds/start-flip.mp3",
42 endFlip: "sounds/end-flip.mp3",
43 },
44 };
45 </script>
46
47 <script>
48 // Ensure the script runs after the page has fully loaded
49
50 // Function to extract the file URL from the query parameters
51 function extractFileParamData(src, $param) {
52 // Parse the URL
53 var url = new URL(src);
54 // Extract the 'file' parameter from the query string
55 var fileUrl = url.searchParams.get($param);
56 return fileUrl;
57 }
58
59 var parentIframeSrc;
60
61 var params = {};
62
63 window.onload = function () {
64 // Access the parent window
65 var parentWindow = window.parent;
66
67 // Get the iframes within the parent window
68 var iframes = parentWindow.document.getElementsByTagName("iframe");
69
70 for (var i = 0; i < iframes.length; i++) {
71 if (iframes[i].contentWindow === window) {
72 // Get the src attribute of the iframe
73 parentIframeSrc = iframes[i].src;
74
75 // Book 1 {
76 jQuery("#viewer-container").FlipBook({
77 pdf: extractFileParamData(parentIframeSrc, "file"),
78 template: template,
79 });
80
81 // The encoded string you want to decode
82 const encodedString = extractFileParamData(parentIframeSrc, "key");
83
84 // Step 1: Base64 Decode
85 const decodedString = atob(encodedString);
86
87 // Step 1: Create URLSearchParams object
88 const urlParams = new URLSearchParams(decodedString);
89
90 // Step 2: Convert URLSearchParams to Object
91 const paramsObject = {};
92 for (const [key, value] of urlParams.entries()) {
93 params[key] =
94 value == "yes" || value == "true"
95 ? true
96 : value == "no"
97 ? false
98 : value;
99 }
100
101
102 const newSettings = decodedString;
103
104 let oldData = localStorage.getItem("flipbook_settings");
105 let settingsArray;
106
107 try {
108 settingsArray = oldData ? JSON.parse(oldData) : [];
109 if (!Array.isArray(settingsArray)) {
110 settingsArray = [];
111 }
112 } catch (e) {
113 settingsArray = [];
114 }
115
116 settingsArray.push(newSettings);
117
118 let newData = JSON.stringify(settingsArray);
119 localStorage.setItem("flipbook_settings", newData);
120
121 let updatedData = localStorage.getItem("flipbook_settings");
122
123
124 break; // Exit the loop once the matching iframe is found and processed
125 }
126 }
127 };
128 </script>
129 </body>
130
131 </html>