dashboard-review-ask.js
4 years ago
ewd-us-admin.js
4 years ago
ewd-us-blocks.js
4 years ago
ewd-us-welcome-screen.js
4 years ago
ewd-us.js
4 years ago
jquery.iframetracker.js
4 years ago
plugin-deactivation.js
4 years ago
ultimate-lightbox.js
4 years ago
plugin-deactivation.js
53 lines
| 1 | jQuery(function($){ |
| 2 | var $deactivateLink = $('#the-list').find('[data-slug="ultimate-slider"] span.deactivate a'), |
| 3 | $overlay = $('#ewd-us-deactivate-survey-ultimate-slider'), |
| 4 | $form = $overlay.find('form'), |
| 5 | formOpen = false; |
| 6 | // Plugin listing table deactivate link. |
| 7 | $deactivateLink.on('click', function(event) { |
| 8 | event.preventDefault(); |
| 9 | $overlay.css('display', 'table'); |
| 10 | formOpen = true; |
| 11 | $form.find('.ewd-us-deactivate-survey-option:first-of-type input[type=radio]').focus(); |
| 12 | }); |
| 13 | // Survey radio option selected. |
| 14 | $form.on('change', 'input[type=radio]', function(event) { |
| 15 | event.preventDefault(); |
| 16 | $form.find('input[type=text], .error').hide(); |
| 17 | $form.find('.ewd-us-deactivate-survey-option').removeClass('selected'); |
| 18 | $(this).closest('.ewd-us-deactivate-survey-option').addClass('selected').find('input[type=text]').show(); |
| 19 | }); |
| 20 | // Survey Skip & Deactivate. |
| 21 | $form.on('click', '.ewd-us-deactivate-survey-deactivate', function(event) { |
| 22 | event.preventDefault(); |
| 23 | location.href = $deactivateLink.attr('href'); |
| 24 | }); |
| 25 | // Survey submit. |
| 26 | $form.submit(function(event) { |
| 27 | event.preventDefault(); |
| 28 | if (! $form.find('input[type=radio]:checked').val()) { |
| 29 | $form.find('.ewd-us-deactivate-survey-footer').prepend('<span class="error">Please select an option below</span>'); |
| 30 | return; |
| 31 | } |
| 32 | var data = { |
| 33 | code: $form.find('.selected input[type=radio]').val(), |
| 34 | install_time: $form.data('installtime'), |
| 35 | reason: $form.find('.selected .ewd-us-deactivate-survey-option-reason').text(), |
| 36 | details: $form.find('.selected input[type=text]').val(), |
| 37 | site: ewd_us_deactivation_data.site_url, |
| 38 | plugin: 'Ultimate Slider' |
| 39 | } |
| 40 | var submitSurvey = $.post('https://www.etoilewebdesign.com/UPCP-Key-Check/Deactivation_Surveys.php', data); |
| 41 | submitSurvey.always(function() { |
| 42 | location.href = $deactivateLink.attr('href'); |
| 43 | }); |
| 44 | }); |
| 45 | // Exit key closes survey when open. |
| 46 | $(document).keyup(function(event) { |
| 47 | if (27 === event.keyCode && formOpen) { |
| 48 | $overlay.hide(); |
| 49 | formOpen = false; |
| 50 | $deactivateLink.focus(); |
| 51 | } |
| 52 | }); |
| 53 | }); |