backup
2 years ago
notices
2 years ago
analytics-consent-modal.js
2 years ago
analytics-consent-modal.js.map
2 years ago
analytics-consent-modal.min.js
2 years ago
analytics-consent-modal.min.js.map
2 years ago
wpstg-admin-beta.js
2 years ago
wpstg-admin-beta.js.map
2 years ago
wpstg-admin-beta.min.js
5 years ago
wpstg-admin-beta.min.js.map
2 years ago
wpstg-admin-corrupt-settings.js
2 years ago
wpstg-admin-corrupt-settings.js.map
2 years ago
wpstg-admin-corrupt-settings.min.js
2 years ago
wpstg-admin-corrupt-settings.min.js.map
2 years ago
wpstg-admin-plugins.js
2 years ago
wpstg-admin-plugins.js.map
2 years ago
wpstg-admin-plugins.min.js
2 years ago
wpstg-admin-plugins.min.js.map
2 years ago
wpstg-admin-rating.js
2 years ago
wpstg-admin-rating.js.map
2 years ago
wpstg-admin-rating.min.js
2 years ago
wpstg-admin-rating.min.js.map
2 years ago
wpstg-admin.js
2 years ago
wpstg-admin.js.map
2 years ago
wpstg-admin.min.js
2 years ago
wpstg-admin.min.js.map
2 years ago
wpstg-blank-loader.js
2 years ago
wpstg-blank-loader.js.map
2 years ago
wpstg-blank-loader.min.js
2 years ago
wpstg-blank-loader.min.js.map
2 years ago
wpstg-sweetalert2.js
2 years ago
wpstg-sweetalert2.js.map
2 years ago
wpstg-sweetalert2.min.js
2 years ago
wpstg-sweetalert2.min.js.map
2 years ago
wpstg.js
2 years ago
wpstg.js.map
2 years ago
wpstg.min.js
2 years ago
wpstg.min.js.map
2 years ago
wpstg-admin-plugins.js
87 lines
| 1 | (function () { |
| 2 | 'use strict'; |
| 3 | |
| 4 | jQuery(document).ready(function ($) { |
| 5 | /** |
| 6 | * DEACTIVATION FEEDBACK FORM |
| 7 | */ |
| 8 | // show overlay when clicked on "deactivate" |
| 9 | var wpstg_deactivate_link = $('.wp-admin.plugins-php tr[data-slug="wp-staging"] .row-actions .deactivate a'); |
| 10 | var wpstg_deactivate_link_url = wpstg_deactivate_link.attr('href'); |
| 11 | console.log('wpstg feedback loaded'); |
| 12 | wpstg_deactivate_link.on('click', function (e) { |
| 13 | e.preventDefault(); |
| 14 | |
| 15 | // only show feedback form once per 30 days |
| 16 | var c_value = wpstg_admin_get_cookie('wpstg_hide_feedback'); |
| 17 | if (c_value === undefined) { |
| 18 | $('#wpstg-feedback-overlay').show(); |
| 19 | } else { |
| 20 | // click on the link |
| 21 | window.location.href = wpstg_deactivate_link_url; |
| 22 | } |
| 23 | }); |
| 24 | // show text fields |
| 25 | $('#wpstg-feedback-content input[type="checkbox"]').on('click', function () { |
| 26 | var $this = $(this); |
| 27 | if ($this.is(':checked')) { |
| 28 | // show text field if there is one |
| 29 | $(this).parents('li').next('li').children('input[type="text"], textarea').show(); |
| 30 | } else { |
| 31 | // hide text field if there is one |
| 32 | $(this).parents('li').next('li').children('input[type="text"], textarea').hide(); |
| 33 | } |
| 34 | }); |
| 35 | // send form or close it |
| 36 | $('#wpstg-feedback-content .button').on('click', function (e) { |
| 37 | e.preventDefault(); |
| 38 | // set cookie for 30 days |
| 39 | var exdate = new Date(); |
| 40 | exdate.setSeconds(exdate.getSeconds() + 2592000); |
| 41 | document.cookie = 'wpstg_hide_feedback=1; expires=' + exdate.toUTCString() + '; path=/'; |
| 42 | $('#wpstg-feedback-overlay').hide(); |
| 43 | if ('wpstg-feedback-submit' === this.id) { |
| 44 | // Send form data |
| 45 | $.ajax({ |
| 46 | type: 'POST', |
| 47 | url: ajaxurl, |
| 48 | dataType: 'json', |
| 49 | data: { |
| 50 | action: 'wpstg_send_feedback', |
| 51 | data: $('#wpstg-feedback-content form').serialize(), |
| 52 | nonce: wpstg.nonce |
| 53 | }, |
| 54 | complete: function complete(MLHttpRequest, textStatus, errorThrown) { |
| 55 | // deactivate the plugin and close the popup |
| 56 | $('#wpstg-feedback-overlay').remove(); |
| 57 | window.location.href = wpstg_deactivate_link_url; |
| 58 | } |
| 59 | }); |
| 60 | } else { |
| 61 | $('#wpstg-feedback-overlay').remove(); |
| 62 | window.location.href = wpstg_deactivate_link_url; |
| 63 | } |
| 64 | }); |
| 65 | // close form without doing anything |
| 66 | $('.wpstg-feedback-not-deactivate').on('click', function (e) { |
| 67 | $('#wpstg-feedback-overlay').hide(); |
| 68 | }); |
| 69 | function wpstg_admin_get_cookie(name) { |
| 70 | var i; |
| 71 | var x; |
| 72 | var y; |
| 73 | var wpstg_cookies = document.cookie.split(';'); |
| 74 | for (i = 0; i < wpstg_cookies.length; i++) { |
| 75 | x = wpstg_cookies[i].substr(0, wpstg_cookies[i].indexOf('=')); |
| 76 | y = wpstg_cookies[i].substr(wpstg_cookies[i].indexOf('=') + 1); |
| 77 | x = x.replace(/^\s+|\s+$/g, ''); |
| 78 | if (x === name) { |
| 79 | return unescape(y); |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | }); |
| 84 | |
| 85 | })(); |
| 86 | //# sourceMappingURL=wpstg-admin-plugins.js.map |
| 87 |