PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 4.6.3
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v4.6.3
4.6.3 4.6.2 4.6.1 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 / js / default-book-view.js
embedpress / assets / pdf-flip-book / js Last commit date
3dflipbook.min.js 1 year ago default-book-view.js 2 years ago html2canvas.min.js 2 years ago pdf.min.js 2 years ago pdf.worker.js 2 years ago three.min.js 2 years ago
default-book-view.js
117 lines
1 /*
2 This file is part of 3D Flip book.
3
4 Copyright (c) 2024 3D Flip book.
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 function init(container) {
21 var instance;
22 if(window.jQuery) {
23 var $ = window.jQuery;
24 instance = {
25 floatWnd: container.find('.float-wnd'),
26 binds: {
27 showDropMenu: function(e) {
28 e.preventDefault();
29 var el = $(e.target);
30 while(!el.hasClass('toggle')) {
31 el = $(el[0].parentNode);
32 }
33 var menu = el.find('.menu');
34 if(menu.hasClass('hidden')) {
35 container.find('.ctrl .fnavbar .menu').addClass('hidden');
36 menu.removeClass('hidden');
37 e.stopPropagation();
38 }
39 },
40 hideDropMenu: function() {
41 container.find('.ctrl .fnavbar .menu').addClass('hidden');
42 },
43 pickFloatWnd: function(e) {
44 if(instance.pos) {
45 instance.binds.dropFloatWnd();
46 }
47 else {
48 instance.pos = {
49 x: e.pageX,
50 y: e.pageY
51 };
52 }
53 },
54 moveFloatWnd: function(e) {
55 if(instance.pos) {
56 var dv = {
57 x: e.pageX-instance.pos.x,
58 y: e.pageY-instance.pos.y
59 }, old = {
60 x: parseInt(instance.floatWnd.css('left')),
61 y: parseInt(instance.floatWnd.css('top'))
62 };
63 instance.floatWnd.css('left', old.x+dv.x+'px').css('top', old.y+dv.y+'px');
64 instance.pos = {
65 x: e.pageX,
66 y: e.pageY
67 };
68 }
69 },
70 dropFloatWnd: function() {
71 delete instance.pos;
72 },
73 jsCenter: function() {
74 var ns = container.find('.js-center');
75 for(var i=0; i<ns.length; ++i) {
76 var n = $(ns[i]), parentWidth = $(ns[i].parentNode).width(), width = n.width();
77 n.css('left', 0.5*(parentWidth-width)+'px');
78 }
79 }
80 },
81 appLoaded: function() {
82 instance.binds.jsCenter();
83 },
84 linkLoaded: function(link) {
85 instance.binds.jsCenter();
86 },
87 dispose: function() {
88 container.find('.ctrl .fnavbar .fnav .toggle').off('click', instance.binds.showDropMenu);
89 $(container[0].ownerDocument).off('click', instance.binds.hideDropMenu);
90
91 $(container[0].ownerDocument).off('mousemove', instance.binds.moveFloatWnd);
92 $(container[0].ownerDocument).off('mouseup', instance.binds.dropFloatWnd);
93 instance.floatWnd.find('.header').off('mousedown', instance.binds.pickFloatWnd);
94
95 $(container[0].ownerDocument.defaultView).off('resize', instance.binds.jsCenter);
96 }
97 };
98 container.find('.ctrl .fnavbar .fnav .toggle').on('click', instance.binds.showDropMenu);
99 $(container[0].ownerDocument).on('click', instance.binds.hideDropMenu);
100
101 $(container[0].ownerDocument).on('mousemove', instance.binds.moveFloatWnd);
102 $(container[0].ownerDocument).on('mouseup', instance.binds.dropFloatWnd);
103 instance.floatWnd.find('.header').on('mousedown', instance.binds.pickFloatWnd);
104
105 $(container[0].ownerDocument.defaultView).on('resize', instance.binds.jsCenter);
106 instance.binds.jsCenter();
107 }
108 else {
109 instance = {
110 dispose: function() {
111 }
112 };
113 console.error('jQuery is not found');
114 }
115 return instance;
116 } init
117