mystickymenu
Last commit date
admin
1 week ago
dist
1 week ago
images
1 year ago
languages
1 week ago
class-email-signup.php
7 months ago
class-help.php
1 month ago
class-review-box.php
1 month ago
class-upgrade-box.php
1 month ago
index.php
8 years ago
mystickymenu-admin-widgetanalytics.php
1 week ago
mystickymenu-contact-leads.php
1 week ago
mystickymenu-deactivate-form.php
1 month ago
mystickymenu-fonts.php
2 years ago
mystickymenu-leads.php
1 week ago
mystickymenu-popup.php
1 month ago
mystickymenu-review-popup.php
9 months ago
mystickymenu.php
1 week ago
mystickymeny-new-welcomebar.php
1 week ago
readme.txt
1 week ago
recommended-plugins.php
7 months ago
uninstall.php
2 years ago
upgrade-to-pro.php
1 month ago
welcome-bar.php
1 week ago
mystickymenu-deactivate-form.php
240 lines
| 1 | <style> |
| 2 | .mystickymenu--hidden { |
| 3 | overflow: hidden; |
| 4 | } |
| 5 | |
| 6 | .mystickymenu--popup-overlay .mystickymenu--internal-message { |
| 7 | margin: 3px 0 3px 22px; |
| 8 | display: none; |
| 9 | } |
| 10 | |
| 11 | .mystickymenu--reason-input { |
| 12 | margin: 3px 0 3px 22px; |
| 13 | display: none; |
| 14 | } |
| 15 | |
| 16 | .mystickymenu--reason-input input[type="text"] { |
| 17 | width: 100%; |
| 18 | display: block; |
| 19 | } |
| 20 | |
| 21 | .mystickymenu--popup-overlay { |
| 22 | background: rgba(0, 0, 0, .8); |
| 23 | position: fixed; |
| 24 | top: 0; |
| 25 | left: 0; |
| 26 | height: 100%; |
| 27 | width: 100%; |
| 28 | z-index: 1000; |
| 29 | overflow: auto; |
| 30 | visibility: hidden; |
| 31 | opacity: 0; |
| 32 | transition: opacity 0.3s ease-in-out : |
| 33 | } |
| 34 | |
| 35 | .mystickymenu--popup-overlay.mystickymenu--active { |
| 36 | opacity: 1; |
| 37 | visibility: visible; |
| 38 | } |
| 39 | |
| 40 | .mystickymenu--serveypanel { |
| 41 | width: 600px; |
| 42 | background: #fff; |
| 43 | margin: 65px auto 0; |
| 44 | } |
| 45 | |
| 46 | .mystickymenu--popup-header { |
| 47 | background: #f1f1f1; |
| 48 | padding: 20px; |
| 49 | border-bottom: 1px solid #ccc; |
| 50 | } |
| 51 | |
| 52 | .mystickymenu--popup-header h2 { |
| 53 | margin: 0; |
| 54 | } |
| 55 | |
| 56 | .mystickymenu--popup-body { |
| 57 | padding: 10px 20px; |
| 58 | } |
| 59 | |
| 60 | .mystickymenu--popup-footer { |
| 61 | background: #f9f3f3; |
| 62 | padding: 10px 20px; |
| 63 | border-top: 1px solid #ccc; |
| 64 | } |
| 65 | |
| 66 | .mystickymenu--popup-footer:after { |
| 67 | content: ""; |
| 68 | display: table; |
| 69 | clear: both; |
| 70 | } |
| 71 | |
| 72 | .action-btns { |
| 73 | float: right; |
| 74 | } |
| 75 | |
| 76 | .mystickymenu--anonymous { |
| 77 | display: none; |
| 78 | } |
| 79 | |
| 80 | .attention, .error-message { |
| 81 | color: red; |
| 82 | font-weight: 600; |
| 83 | display: none; |
| 84 | } |
| 85 | |
| 86 | .mystickymenu--spinner { |
| 87 | display: none; |
| 88 | } |
| 89 | |
| 90 | .mystickymenu--spinner img { |
| 91 | margin-top: 3px; |
| 92 | } |
| 93 | |
| 94 | .mystickymenu--hidden-input { |
| 95 | padding: 10px 0 0; |
| 96 | display: none; |
| 97 | } |
| 98 | .mystickymenu--popup-body textarea { |
| 99 | padding: 10px; |
| 100 | width: 100%; |
| 101 | height: 100px; |
| 102 | margin: 0 0 10px 0; |
| 103 | } |
| 104 | |
| 105 | span.mystickymenu--error-message { |
| 106 | color: #dd0000; |
| 107 | font-weight: 600; |
| 108 | } |
| 109 | .mystickymenu--popup-body h3 { |
| 110 | line-height: 24px; |
| 111 | } |
| 112 | .mystickymenu--popup-overlay .form-control input { |
| 113 | width: 100%; |
| 114 | margin: 0 0 15px 0; |
| 115 | } |
| 116 | </style> |
| 117 | |
| 118 | <div class="mystickymenu--popup-overlay"> |
| 119 | <div class="mystickymenu--serveypanel"> |
| 120 | <form action="#" method="post" id="mystickymenu--deactivate-form"> |
| 121 | <div class="mystickymenu--popup-header"> |
| 122 | <h2><?php esc_html_e('Quick feedback about My Sticky Bar', "mystickymenu"); ?> 🙏</h2> |
| 123 | </div> |
| 124 | <div class="mystickymenu--popup-body"> |
| 125 | <h3><?php esc_html_e('Your feedback will help us improve the product, please tell us why did you decide to deactivate My Sticky Bar :)', "mystickymenu"); ?></h3> |
| 126 | <div class="form-control"> |
| 127 | <input type="email" value="<?php echo esc_attr(get_option( 'admin_email' )) ?>" placeholder="<?php echo esc_html_e("Email address", "mystickymenu") ?>" id="mystickymenu-deactivation-email_id"> |
| 128 | </div> |
| 129 | <div class="form-control"> |
| 130 | <textarea placeholder="<?php echo esc_html_e("Your comment", "mystickymenu") ?>" id="mystickymenu-deactivation-comment"></textarea> |
| 131 | </div> |
| 132 | </div> |
| 133 | <div class="mystickymenu--popup-footer"> |
| 134 | <label class="mystickymenu--anonymous"> |
| 135 | <input type="checkbox"/><?php esc_html_e('Anonymous feedback', "mystickymenu"); ?> |
| 136 | </label> |
| 137 | <input type="button" class="button button-secondary button-skip mystickymenu--popup-skip-feedback" value=<?php esc_attr_e('Skip & Deactivate', 'mystickymenu'); ?>> |
| 138 | <div class="action-btns"> |
| 139 | <span class="mystickymenu--spinner"><img src="<?php echo esc_url(admin_url('/images/spinner.gif')); ?>" alt=""></span> |
| 140 | <input type="submit" class="button button-secondary button-deactivate mystickymenu--popup-allow-deactivate" value="<?php esc_attr_e('Submit & Deactivate', 'mystickymenu'); ?>" disabled="disabled"> |
| 141 | <a href="#" class="button button-primary mystickymenu--popup-button-close"><?php esc_html_e('Cancel', "mystickymenu"); ?></a> |
| 142 | </div> |
| 143 | </div> |
| 144 | </form> |
| 145 | </div> |
| 146 | </div> |
| 147 | |
| 148 | |
| 149 | <script> |
| 150 | (function ($) { |
| 151 | |
| 152 | $(function () { |
| 153 | |
| 154 | var pluginSlug = 'mystickymenu'; |
| 155 | // Code to fire when the DOM is ready. |
| 156 | |
| 157 | $(document).on('click', 'tr[data-slug="' + pluginSlug + '"] .deactivate', function (e) { |
| 158 | e.preventDefault(); |
| 159 | |
| 160 | $('.mystickymenu--popup-overlay').addClass('mystickymenu--active'); |
| 161 | $('body').addClass('mystickymenu--hidden'); |
| 162 | }); |
| 163 | $(document).on('click', '.mystickymenu--popup-button-close', function () { |
| 164 | close_popup(); |
| 165 | }); |
| 166 | $(document).on('click', ".mystickymenu--serveypanel,tr[data-slug='" + pluginSlug + "'] .deactivate", function (e) { |
| 167 | e.stopPropagation(); |
| 168 | }); |
| 169 | |
| 170 | $(document).on( 'click', function () { |
| 171 | close_popup(); |
| 172 | }); |
| 173 | $('.mystickymenu--reason label').on('click', function () { |
| 174 | $(".mystickymenu--hidden-input").hide(); |
| 175 | jQuery(".mystickymenu--error-message").remove(); |
| 176 | if ($(this).find('input[type="radio"]').is(':checked')) { |
| 177 | $(this).closest("li").find('.mystickymenu--hidden-input').show(); |
| 178 | } |
| 179 | }); |
| 180 | $(document).on("keyup", "#mystickymenu-deactivation-comment", function(){ |
| 181 | if($.trim($(this).val()) == "") { |
| 182 | $(".mystickymenu--popup-allow-deactivate").attr("disabled", true); |
| 183 | } else { |
| 184 | $(".mystickymenu--popup-allow-deactivate").attr("disabled", false); |
| 185 | } |
| 186 | }); |
| 187 | $('input[type="radio"][name="mystickymenu--selected-reason"]').on('click', function (event) { |
| 188 | $(".mystickymenu--popup-allow-deactivate").removeAttr('disabled'); |
| 189 | }); |
| 190 | $(document).on('submit', '#mystickymenu--deactivate-form', function (event) { |
| 191 | event.preventDefault(); |
| 192 | _reason = ""; |
| 193 | if(jQuery.trim(jQuery("#mystickymenu-deactivation-comment").val()) == "") { |
| 194 | jQuery("#alt_plugin").after("<span class='mystickymenu--error-message'><?php esc_html_e('Please provide your feedback', 'mystickymenu'); ?></span>"); |
| 195 | return false; |
| 196 | } else { |
| 197 | _reason = jQuery.trim(jQuery("#mystickymenu-deactivation-comment").val()); |
| 198 | } |
| 199 | |
| 200 | jQuery('[name="mystickymenu--selected-reason"]:checked').val(); |
| 201 | |
| 202 | var email_id = jQuery.trim(jQuery("#mystickymenu-deactivation-email_id").val()); |
| 203 | |
| 204 | $.ajax({ |
| 205 | url: ajaxurl, |
| 206 | type: 'POST', |
| 207 | data: { |
| 208 | action: 'mystickymenu_plugin_deactivate', |
| 209 | reason: _reason, |
| 210 | email_id: email_id, |
| 211 | nonce: '<?php echo esc_attr(wp_create_nonce("mystickymenu_deactivate_nonce")) ?>' |
| 212 | }, |
| 213 | beforeSend: function () { |
| 214 | $(".mystickymenu--spinner").show(); |
| 215 | $(".mystickymenu--popup-allow-deactivate").attr("disabled", "disabled"); |
| 216 | } |
| 217 | }).done(function (status) { |
| 218 | $(".mystickymenu--spinner").hide(); |
| 219 | $(".mystickymenu--popup-allow-deactivate").removeAttr("disabled"); |
| 220 | window.location.href = $("tr[data-slug='" + pluginSlug + "'] .deactivate a").attr('href'); |
| 221 | }); |
| 222 | }); |
| 223 | |
| 224 | $('.mystickymenu--popup-skip-feedback').on('click', function (e) { |
| 225 | window.location.href = $("tr[data-slug='" + pluginSlug + "'] .deactivate a").attr('href'); |
| 226 | }) |
| 227 | |
| 228 | function close_popup() { |
| 229 | $('.mystickymenu--popup-overlay').removeClass('mystickymenu--active'); |
| 230 | $('#mystickymenu--deactivate-form').trigger("reset"); |
| 231 | $(".mystickymenu--popup-allow-deactivate").attr('disabled', 'disabled'); |
| 232 | $(".mystickymenu--reason-input").hide(); |
| 233 | $('body').removeClass('mystickymenu--hidden'); |
| 234 | $('.message.error-message').hide(); |
| 235 | } |
| 236 | }); |
| 237 | |
| 238 | })(jQuery); // This invokes the function above and allows us to use '$' in place of 'jQuery' in our code. |
| 239 | </script> |
| 240 |