jquery
5 years ago
admin.js
4 years ago
pmxe.js
12 years ago
scheduling.js
8 years ago
upgrade-notice.js
4 years ago
validate-braces.js
8 years ago
upgrade-notice.js
56 lines
| 1 | (function($){$(function () { |
| 2 | window.openUpgradeNotice = function(addon, element, preloaderSrc) { |
| 3 | $('.wpallexport-overlay').show(); |
| 4 | $('.wpallexport-loader').show(); |
| 5 | |
| 6 | var $self = element; |
| 7 | $.ajax({ |
| 8 | type: "POST", |
| 9 | url: ajaxurl, |
| 10 | context: element, |
| 11 | data: { |
| 12 | 'action': 'wpae_upgrade_notice', |
| 13 | 'addon': addon, |
| 14 | 'security' : wp_all_export_security |
| 15 | }, |
| 16 | success: function (data) { |
| 17 | |
| 18 | $('.wpallexport-loader').hide(); |
| 19 | $(this).pointer({ |
| 20 | content: '<div id="wpallexport-upgrade-notice">' + data + '</div>', |
| 21 | position: { |
| 22 | edge: 'right', |
| 23 | align: 'center' |
| 24 | }, |
| 25 | pointerWidth: 815, |
| 26 | show: function (event, t) { |
| 27 | var $leftOffset = ($(window).width() - 715) / 2; |
| 28 | var $topOffset = $(document).scrollTop() + 100; |
| 29 | |
| 30 | var $pointer = $('.wp-pointer').last(); |
| 31 | $pointer.css({'position': 'absolute', 'top': $topOffset + 'px', 'left': $leftOffset + 'px'}); |
| 32 | |
| 33 | $('.already-have-link').on('click', function() { |
| 34 | $pointer.find('.upgrade').hide(); |
| 35 | $pointer.find('.install').show(); |
| 36 | }); |
| 37 | |
| 38 | $('.custom-close').on('click', function() { |
| 39 | element.pointer('close'); |
| 40 | }); |
| 41 | }, |
| 42 | close: function () { |
| 43 | jQuery('.wpallexport-overlay').hide(); |
| 44 | } |
| 45 | }).pointer('open'); |
| 46 | $('.wp-pointer-buttons').hide(); |
| 47 | }, |
| 48 | error: function () { |
| 49 | $('#pmxe_button_preloader').remove(); |
| 50 | $('.close-pointer').show(); |
| 51 | $(".wpallexport-overlay").trigger('click'); |
| 52 | $('.wpallexport-loader').hide(); |
| 53 | } |
| 54 | }); |
| 55 | }; |
| 56 | });})(jQuery); |