PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 5.13.0
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v5.13.0
5.12.0 5.13.0 5.13.1 5.11.0 5.10.0 5.9.0 5.8.0 5.8.1 5.7.0 5.6.2 5.6.3 5.6.1 5.6.0 5.5.0 5.4.0 5.3.2 5.3.1 5.1.6 5.1.5 trunk 2.1.5 2.11 2.12 2.13 2.15 All 47 releases
double-opt-in / compatibility / cf7 / assets / f12-cf7-popup.js

f12-cf7-popup.js in Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification 5.13.0, at compatibility/cf7/assets/f12-cf7-popup.js

56 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(document).ready(function ($) {
2 $('.f12-cf7-details').on('click', function () {
3 var hash = $(this).attr('data-hash');
4
5 if (hash) {
6 $.ajax({
7 url: doi.ajax_url,
8 type: 'post',
9 data: {
10 action: 'f12_doi_details',
11 nonce: doi.nonce,
12 hash: hash
13 },
14 success(data) {
15 var data = JSON.parse(data);
16 showPopup(data.content);
17 }
18 })
19 }
20 });
21
22 function removePopup() {
23 $(document).find('.forge12-plugin-popup, .forge12-plugin-popup-overlay').remove();
24 }
25
26 function showPopup(content) {
27 removePopup();
28 $('body').append(
29 '<div class="forge12-plugin-popup-overlay"></div>' +
30 '<div class="forge12-plugin-popup">' +
31 '<button type="button" class="forge12-plugin-popup-close">' +
32 '<span class="dashicons dashicons-no-alt"></span>' +
33 '</button>' +
34 '<div class="forge12-plugin-popup-content">' + content + '</div>' +
35 '</div>'
36 );
37 }
38
39 $(document).on('click', '.forge12-plugin-popup-close', function () {
40 removePopup();
41 });
42
43 $(document).on('click', '.forge12-plugin-popup-overlay', function () {
44 removePopup();
45 });
46
47 $(document).on('mouseenter', '.forge12-plugin-popup .doi-tooltip', function () {
48 var $tip = $(this).find('.doi-tooltip-text');
49 var rect = this.getBoundingClientRect();
50 var tipW = 260;
51 var left = rect.left + rect.width / 2 - tipW / 2;
52 if (left < 8) left = 8;
53 if (left + tipW > window.innerWidth - 8) left = window.innerWidth - tipW - 8;
54 $tip.css({ left: left + 'px', bottom: (window.innerHeight - rect.top + 8) + 'px' });
55 });
56 });