PluginProbe
Order Tracking – WordPress Status Tracking Plugin / 3.2.2
Order Tracking – WordPress Status Tracking Plugin v3.2.2
3.5.4 3.5.3 3.5.2 3.5.1 3.5.0 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.3.0 3.3.1 3.3.10 3.3.11 3.3.12 3.3.13 3.3.14 3.3.15 All 235 releases
order-tracking / assets / js / plugin-deactivation.js

plugin-deactivation.js in Order Tracking – WordPress Status Tracking Plugin 3.2.2, at assets/js/plugin-deactivation.js

56 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(function($){
2 // This is a temporary addition. Remove along with Main.php summer 2021
3 $('#the-list').find('[data-plugin="order-tracking/Main.php"]').hide();
4
5 var $deactivateLink = $('#the-list').find('[data-slug="order-tracking"] span.deactivate a'),
6 $overlay = $('#ewd-otp-deactivate-survey-order-tracking'),
7 $form = $overlay.find('form'),
8 formOpen = false;
9 // Plugin listing table deactivate link.
10 $deactivateLink.on('click', function(event) {
11 event.preventDefault();
12 $overlay.css('display', 'table');
13 formOpen = true;
14 $form.find('.ewd-otp-deactivate-survey-option:first-of-type input[type=radio]').focus();
15 });
16 // Survey radio option selected.
17 $form.on('change', 'input[type=radio]', function(event) {
18 event.preventDefault();
19 $form.find('input[type=text], .error').hide();
20 $form.find('.ewd-otp-deactivate-survey-option').removeClass('selected');
21 $(this).closest('.ewd-otp-deactivate-survey-option').addClass('selected').find('input[type=text]').show();
22 });
23 // Survey Skip & Deactivate.
24 $form.on('click', '.ewd-otp-deactivate-survey-deactivate', function(event) {
25 event.preventDefault();
26 location.href = $deactivateLink.attr('href');
27 });
28 // Survey submit.
29 $form.submit(function(event) {
30 event.preventDefault();
31 if (! $form.find('input[type=radio]:checked').val()) {
32 $form.find('.ewd-otp-deactivate-survey-footer').prepend('<span class="error">Please select an option below</span>');
33 return;
34 }
35 var data = {
36 code: $form.find('.selected input[type=radio]').val(),
37 install_time: $form.data('installtime'),
38 reason: $form.find('.selected .ewd-otp-deactivate-survey-option-reason').text(),
39 details: $form.find('.selected input[type=text]').val(),
40 site: ewd_otp_deactivation_data.site_url,
41 plugin: 'Order Tracking'
42 }
43 var submitSurvey = $.post('https://www.etoilewebdesign.com/UPCP-Key-Check/Deactivation_Surveys.php', data);
44 submitSurvey.always(function() {
45 location.href = $deactivateLink.attr('href');
46 });
47 });
48 // Exit key closes survey when open.
49 $(document).keyup(function(event) {
50 if (27 === event.keyCode && formOpen) {
51 $overlay.hide();
52 formOpen = false;
53 $deactivateLink.focus();
54 }
55 });
56 });