PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more / 4.2.7
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more v4.2.7
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 / js / license.js
embedpress / assets / js Last commit date
vendor 7 years ago admin.js 1 year ago ads.js 1 year ago carousel.js 1 year ago carousel.min.js 2 years ago documents-viewer-script.js 3 years ago embed-ui.min.js 1 year ago front.js 1 year ago gallery-justify.js 1 year ago glider.js 1 year ago glider.min.js 2 years ago gutneberg-script.js 1 year ago index.html 7 years ago initCarousel.js 2 years ago initplyr.js 2 years ago instafeed.js 2 years ago license.js 2 years ago pdfobject.js 1 year ago plyr.js 1 year ago plyr.polyfilled.js 3 years ago preview.js 3 years ago settings.js 6 years ago vimeo-player.js 2 years ago ytiframeapi.js 2 years ago
license.js
232 lines
1 /**
2 * @package EmbedPress
3 * @author EmbedPress <help@embedpress.com>
4 * @copyright Copyright (C) 2018 EmbedPress. All rights reserved.
5 * @license GPLv2 or later
6 * @since 1.7.0
7 */
8 (function ($) {
9 'use strict';
10
11 var __ = wp.i18n.__;
12 var addQueryArgs = wp.url.addQueryArgs;
13
14 $(document).on('click', '.embedpress-license-activation-btn', function (e) {
15 e.preventDefault();
16 let $this = $(this);
17
18 const licensesKey = $('#embedpress-pro-license-key').val();
19
20 if (licensesKey) {
21 $this.attr('disabled', 'disabled');
22 $this.html(__('Sending Request.....', 'embedpress'));
23 }
24
25 $.ajax({
26 type: 'POST',
27 url: ajaxurl,
28 data: {
29 // Your data to be sent in the request body
30 action: 'embedpress/license/activate',
31 _nonce: wpdeveloperLicenseManagerNonce.embedpress_lisence_nonce, //
32 license_key: licensesKey,
33 },
34 success: function (response) {
35 // Handle the successful response here
36 if (!response.success) {
37 $this.html(__('Active License', 'embedpress'));
38 $this.removeAttr('disabled');
39 $('.embedpress-toast__message.toast__message--error p').text(response?.data?.message);
40 $('.toast__message--error').addClass('show-toast');
41
42 setTimeout(() => {
43 $('.toast__message--error').removeClass('show-toast');
44 }, 2000);
45
46 }
47 else if (response.data.license === 'valid') {
48 activationMessage();
49 }
50 else if (response.data.license === 'required_otp') {
51 $this.html(__('Verification Required', 'embedpress'));
52 $('#valid-license-key-message').removeClass('hidden');
53 $('#email-placeholder').text(response.data.customer_email);
54 $('#embedpress-pro-license-key').attr('disabled', 'disabled');
55
56 $('.embedpress-toast__message.toast__message--success p').text('Verification Code Sent successfully');
57 $('.toast__message--success').addClass('show-toast');
58
59 setTimeout(() => {
60 $('.toast__message--success').removeClass('show-toast');
61 }, 2000);
62
63 $('#otp-varify-form').removeClass('hidden');
64 }
65 },
66 error: function (xhr, status, error) {
67 // Handle errors here
68 console.error('Error:', status, error);
69 }
70 });
71
72 });
73
74 $(document).on('click', '.embedpress-verification-activation-btn', function (e) {
75 e.preventDefault();
76 let $this = $(this);
77
78 const licensesKey = $('#embedpress-pro-license-key').val();
79 const otpCode = $('#embedpress-pro-verification-key').val();
80
81 $('#invalid-verification-key-message').addClass('hidden');
82
83 if (licensesKey) {
84 $this.attr('disabled', 'disabled');
85 $this.html(__('Verifying.....', 'embedpress'));
86 }
87 // var ajaxUrl = 'embedpress/license/activate'; // Replace with the actual URL
88
89 $.ajax({
90 type: 'POST',
91 url: ajaxurl,
92 data: {
93 // Your data to be sent in the request body
94 action: 'embedpress/license/submit-otp',
95 _nonce: wpdeveloperLicenseManagerNonce.embedpress_lisence_nonce, //
96 license: licensesKey,
97 otp: otpCode,
98 },
99 success: function (response) {
100 // Handle the successful response here
101 console.log('Success:', response);
102 if (!response.success) {
103 $this.html('Verify');
104 $this.removeAttr('disabled');
105 $('.embedpress-toast__message.toast__message--error p').text(response?.data?.message);
106 $('.toast__message--error').addClass('show-toast');
107 setTimeout(() => {
108 $('.toast__message--error').removeClass('show-toast');
109 }, 2000);
110
111 }
112 else {
113 $this.html(__('Verified', 'embedpress'));
114 activationMessage();
115 }
116 },
117 error: function (xhr, status, error) {
118 // Handle errors here
119 console.error('Error:', status, error);
120 }
121 });
122
123 });
124 $(document).on('click', '#resend-license-verification-key', function (e) {
125 e.preventDefault();
126 let $this = $(this);
127
128
129 const licensesKey = $('#embedpress-pro-license-key').val();
130 $('#resend-license-verification-key').text(__('Resending', 'embedpress'));
131
132 $.ajax({
133 type: 'POST',
134 url: ajaxurl,
135 data: {
136 // Your data to be sent in the request body
137 action: 'embedpress/license/resend-otp',
138 _nonce: wpdeveloperLicenseManagerNonce.embedpress_lisence_nonce, //
139 license: licensesKey,
140 },
141 success: function (response) {
142 // Handle the successful response here
143 console.log('Success:', response);
144 if (!response.success) {
145 $('.embedpress-toast__message.toast__message--error p').text(response?.data?.message);
146 $('.toast__message--error').addClass('show-toast');
147
148 setTimeout(() => {
149 $('.toast__message--error').removeClass('show-toast');
150 }, 2000);
151
152 }
153 else {
154 $('.embedpress-toast__message.toast__message--success p').text('Verification Code Resent Successfully.');
155 $('.toast__message--success').addClass('show-toast');
156
157 setTimeout(() => {
158 $('.toast__message--success').removeClass('show-toast');
159 }, 2000);
160 }
161
162 $('#resend-license-verification-key').text(__('Resend', 'embedpress'));
163
164 },
165 error: function (xhr, status, error) {
166 // Handle errors here
167 console.error('Error:', status, error);
168 }
169 });
170
171 });
172
173 $(document).on('click', '.embedpress-license-deactivation-btn', function (e) {
174 e.preventDefault();
175 let $this = $(this);
176
177 const licensesKey = $('#embedpress-pro-license-key').val();
178 const otpCode = $('#embedpress-pro-verification-key').val();
179
180 console.log(licensesKey);
181
182 if (licensesKey) {
183 $this.attr('disabled', 'disabled');
184 $this.html(__('Deactivating.....', 'embedpress'));
185 }
186 // var ajaxUrl = 'embedpress/license/activate'; // Replace with the actual URL
187
188 $.ajax({
189 type: 'POST',
190 url: ajaxurl,
191 data: {
192 // Your data to be sent in the request body
193 action: 'embedpress/license/deactivate',
194 _nonce: wpdeveloperLicenseManagerNonce.embedpress_lisence_nonce, //
195 },
196 success: function (response) {
197 // Handle the successful response here
198 console.log('Success:', response);
199 if (response.success) {
200 deactivationMessage();
201 }
202 },
203 error: function (xhr, status, error) {
204 // Handle errors here
205 console.error('Error:', status, error);
206 }
207 });
208
209 });
210
211 function activationMessage() {
212 var currentUrl = window.location.href;
213 var newUrl = addQueryArgs(currentUrl, {
214 success: true,
215 message: __('License has been activated', 'embedpress')
216 });
217 window.location.href = newUrl;
218 }
219 function deactivationMessage() {
220 var currentUrl = window.location.href;
221 var newUrl = addQueryArgs(currentUrl, {
222 success: true,
223 message: __('License has been deactivated', 'embedpress')
224 });
225
226 window.location.href = newUrl;
227 }
228
229
230
231 })(jQuery);
232