admin-content.php
5 years ago
folder-deactivate-form.php
5 years ago
folder-popup.php
5 years ago
general-settings.php
5 years ago
help.php
5 years ago
media-replace.php
5 years ago
recommended-plugins.php
5 years ago
update.php
5 years ago
upgrade-table.php
5 years ago
upgrade-to-pro.php
5 years ago
folder-deactivate-form.php
125 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 | ?> |
| 4 | <style> |
| 5 | .folder-hidden{overflow:hidden}.folder-popup-overlay .folder-internal-message{margin:3px 0 3px 22px;display:none}.folder-reason-input{margin:3px 0 3px 22px;display:none}.folder-reason-input input[type=text]{width:100%;display:block}.folder-popup-overlay{background:rgba(0,0,0,.8);position:fixed;top:0;left:0;height:100%;width:100%;z-index:1000;overflow:auto;visibility:hidden;opacity:0;transition:opacity .3s ease-in-out :}.folder-popup-overlay.folder-active{opacity:1;visibility:visible}.folder-serveypanel{width:600px;background:#fff;margin:65px auto 0}.folder-popup-header{background:#f1f1f1;padding:20px;border-bottom:1px solid #ccc}.folder-popup-header h2{margin:0}.folder-popup-body{padding:10px 20px}.folder-popup-footer{background:#f9f3f3;padding:10px 20px;border-top:1px solid #ccc}.folder-popup-footer:after{content:"";display:table;clear:both}.action-btns{float:right}.folder-anonymous{display:none}.attention,.error-message{color:red;font-weight:600;display:none}.folder-spinner{display:none}.folder-spinner img{margin-top:3px}.folder-hidden-input{padding:10px 0 0;display:none}.folder-hidden-input input[type=text]{padding:0 10px;width:100%;height:26px;line-height:26px}.folder-hidden-input textarea{padding:10px;width:100%;height:100px;margin:0 0 10px 0}span.folder-error-message{color:#d00;font-weight:600}.form-control textarea{width:100%;height:100px;margin-bottom:10px} |
| 6 | </style> |
| 7 | |
| 8 | <div class="folder-popup-overlay"> |
| 9 | <div class="folder-serveypanel"> |
| 10 | <form action="#" method="post" id="folder-deactivate-form"> |
| 11 | <div class="folder-popup-header"> |
| 12 | <h2><?php esc_html_e('Quick feedback about Folders', 'folders'); ?> 🙏</h2> |
| 13 | </div> |
| 14 | <div class="folder-popup-body"> |
| 15 | <h3><?php esc_html_e('Your feedback will help us improve the product, please tell us why did you decide to deactivate Folders :)', 'folders'); ?></h3> |
| 16 | <div class="form-control"> |
| 17 | <input type="email" value="<?php echo get_option( 'admin_email' ) ?>" placeholder="<?php echo _e("Email address", 'folders'); ?>" id="folder-deactivate-email_id"> |
| 18 | </div> |
| 19 | <div class="form-control"> |
| 20 | <label></label> |
| 21 | <textarea placeholder="<?php esc_html_e("Your comment", 'folders'); ?>" id="folder-comment"></textarea> |
| 22 | </div> |
| 23 | <?php esc_html_e("Having any problem with the Folders plugins?", 'folders'); ?><a class='folder-deactivate-button' href='javascript:;'><?php esc_html_e("Click here", 'folders'); ?></a><?php esc_html_e(" to contact our support now", 'folders'); ?> |
| 24 | </div> |
| 25 | <div class="folder-popup-footer"> |
| 26 | <label class="folder-anonymous"><input type="checkbox"/><?php esc_html_e('Anonymous feedback', 'folders'); ?> |
| 27 | </label> |
| 28 | <input type="button" class="button button-secondary button-skip folder-popup-skip-feedback" value="Skip & Deactivate"> |
| 29 | |
| 30 | <div class="action-btns"> |
| 31 | <span class="folder-spinner"> |
| 32 | <img src="<?php echo esc_url(admin_url('/images/spinner.gif')); ?>" alt=""> |
| 33 | </span> |
| 34 | <input type="submit" class="button button-secondary button-deactivate folder-popup-allow-deactivate" value="Submit & Deactivate" disabled="disabled"> |
| 35 | <a href="#" class="button button-primary folder-popup-button-close"><?php esc_attr_e('Cancel', 'folders'); ?></a> |
| 36 | </div> |
| 37 | </div> |
| 38 | </form> |
| 39 | </div> |
| 40 | </div> |
| 41 | |
| 42 | |
| 43 | <script> |
| 44 | (function ($) { |
| 45 | |
| 46 | $(function () { |
| 47 | |
| 48 | $(document).on("click", ".folder-deactivate-button", function(e){ |
| 49 | e.stopPropagation(); |
| 50 | jQuery(".folder-popup-button-close").trigger("click"); |
| 51 | jQuery(".folder-help-btn").toggle(); |
| 52 | jQuery(".folder-help-form").toggleClass("active"); |
| 53 | jQuery("#user_email").focus(); |
| 54 | }); |
| 55 | |
| 56 | /* Diffrent folder slug for Free/Pro */ |
| 57 | var folderPluginSlug = 'folders'; |
| 58 | // Code to fire when the DOM is ready. |
| 59 | |
| 60 | $(document).on('click', 'tr[data-slug="' + folderPluginSlug + '"] .deactivate', function (e) { |
| 61 | e.preventDefault(); |
| 62 | |
| 63 | $('.folder-popup-overlay').addClass('folder-active'); |
| 64 | $('body').addClass('folder-hidden'); |
| 65 | }); |
| 66 | $(document).on('click', '.folder-popup-button-close', function () { |
| 67 | close_popup(); |
| 68 | }); |
| 69 | $(document).on('click', ".folder-serveypanel,tr[data-slug='" + folderPluginSlug + "'] .deactivate", function (e) { |
| 70 | e.stopPropagation(); |
| 71 | }); |
| 72 | |
| 73 | $(document).click(function () { |
| 74 | close_popup(); |
| 75 | }); |
| 76 | $(document).on("keyup", "#folder-comment", function(){ |
| 77 | if($.trim($(this).val()) == "") { |
| 78 | $(".folder-popup-allow-deactivate").attr("disabled", true); |
| 79 | } else { |
| 80 | $(".folder-popup-allow-deactivate").attr("disabled", false); |
| 81 | } |
| 82 | }); |
| 83 | $(document).on('submit', '#folder-deactivate-form', function (event) { |
| 84 | event.preventDefault(); |
| 85 | |
| 86 | var _reason = jQuery('#folder-comment').val(); |
| 87 | var _email_id = jQuery('#folder-deactivate-email_id').val(); |
| 88 | |
| 89 | $.ajax({ |
| 90 | url: ajaxurl, |
| 91 | type: 'POST', |
| 92 | data: { |
| 93 | action: 'folder_plugin_deactivate', |
| 94 | reason: _reason, |
| 95 | email_id: _email_id, |
| 96 | nonce: '<?php echo esc_attr(wp_create_nonce('wcp_folder_deactivate_nonce')) ?>' |
| 97 | }, |
| 98 | beforeSend: function () { |
| 99 | $(".folder-spinner").show(); |
| 100 | $(".folder-popup-allow-deactivate").attr("disabled", "disabled"); |
| 101 | } |
| 102 | }).done(function (res) { |
| 103 | $(".folder-spinner").hide(); |
| 104 | $(".folder-popup-allow-deactivate").removeAttr("disabled"); |
| 105 | window.location.href = $("tr[data-slug='" + folderPluginSlug + "'] .deactivate a").attr('href'); |
| 106 | }); |
| 107 | }); |
| 108 | |
| 109 | $('.folder-popup-skip-feedback').on('click', function (e) { |
| 110 | window.location.href = $("tr[data-slug='" + folderPluginSlug + "'] .deactivate a").attr('href'); |
| 111 | }); |
| 112 | |
| 113 | function close_popup() { |
| 114 | $('.folder-popup-overlay').removeClass('folder-active'); |
| 115 | $('#folder-deactivate-form').trigger("reset"); |
| 116 | $(".folder-popup-allow-deactivate").attr('disabled', 'disabled'); |
| 117 | $(".folder-reason-input").hide(); |
| 118 | $('body').removeClass('folder-hidden'); |
| 119 | $('.message.error-message').hide(); |
| 120 | } |
| 121 | }); |
| 122 | |
| 123 | })(jQuery); // This invokes the function above and allows us to use '$' in place of 'jQuery' in our code. |
| 124 | </script> |
| 125 | <?php include_once dirname(__FILE__)."/help.php" ?> |