wpel-pointers.js
35 lines
| 1 | /* |
| 2 | * WP External Links |
| 3 | * Backend GUI pointers |
| 4 | * (c) WebFactory Ltd, 2017 - 2022 |
| 5 | */ |
| 6 | |
| 7 | jQuery(document).ready(function ($) { |
| 8 | if (typeof wpel_pointers == 'undefined') { |
| 9 | return; |
| 10 | } |
| 11 | |
| 12 | $.each(wpel_pointers, function (index, pointer) { |
| 13 | if (index.charAt(0) == '_') { |
| 14 | return true; |
| 15 | } |
| 16 | $(pointer.target) |
| 17 | .pointer({ |
| 18 | content: '<h3>WP External Links</h3><p>' + pointer.content + '</p>', |
| 19 | pointerWidth: 380, |
| 20 | position: { |
| 21 | edge: pointer.edge, |
| 22 | align: pointer.align, |
| 23 | }, |
| 24 | close: function () { |
| 25 | $.get(ajaxurl, { |
| 26 | notice_name: index, |
| 27 | _ajax_nonce: wpel_pointers._nonce_dismiss_pointer, |
| 28 | action: 'wpel_dismiss_notice', |
| 29 | }); |
| 30 | }, |
| 31 | }) |
| 32 | .pointer('open'); |
| 33 | }); |
| 34 | }); |
| 35 |