admin-content.php
6 years ago
folder-deactivate-form.php
6 years ago
folder-popup.php
6 years ago
general-settings.php
6 years ago
help.php
6 years ago
update.php
6 years ago
upgrade-to-pro.php
6 years ago
folder-deactivate-form.php
421 lines
| 1 | <?php |
| 2 | defined('ABSPATH') or wp_die('Nope, not accessing this'); |
| 3 | ?> |
| 4 | <style> |
| 5 | .folder-hidden { |
| 6 | overflow: hidden; |
| 7 | } |
| 8 | |
| 9 | .folder-popup-overlay .folder-internal-message { |
| 10 | margin: 3px 0 3px 22px; |
| 11 | display: none; |
| 12 | } |
| 13 | |
| 14 | .folder-reason-input { |
| 15 | margin: 3px 0 3px 22px; |
| 16 | display: none; |
| 17 | } |
| 18 | |
| 19 | .folder-reason-input input[type="text"] { |
| 20 | width: 100%; |
| 21 | display: block; |
| 22 | } |
| 23 | |
| 24 | .folder-popup-overlay { |
| 25 | background: rgba(0, 0, 0, .8); |
| 26 | position: fixed; |
| 27 | top: 0; |
| 28 | left: 0; |
| 29 | height: 100%; |
| 30 | width: 100%; |
| 31 | z-index: 1000; |
| 32 | overflow: auto; |
| 33 | visibility: hidden; |
| 34 | opacity: 0; |
| 35 | transition: opacity 0.3s ease-in-out : |
| 36 | } |
| 37 | |
| 38 | .folder-popup-overlay.folder-active { |
| 39 | opacity: 1; |
| 40 | visibility: visible; |
| 41 | } |
| 42 | |
| 43 | .folder-serveypanel { |
| 44 | width: 600px; |
| 45 | background: #fff; |
| 46 | margin: 65px auto 0; |
| 47 | } |
| 48 | |
| 49 | .folder-popup-header { |
| 50 | background: #f1f1f1; |
| 51 | padding: 20px; |
| 52 | border-bottom: 1px solid #ccc; |
| 53 | } |
| 54 | |
| 55 | .folder-popup-header h2 { |
| 56 | margin: 0; |
| 57 | } |
| 58 | |
| 59 | .folder-popup-body { |
| 60 | padding: 10px 20px; |
| 61 | } |
| 62 | |
| 63 | .folder-popup-footer { |
| 64 | background: #f9f3f3; |
| 65 | padding: 10px 20px; |
| 66 | border-top: 1px solid #ccc; |
| 67 | } |
| 68 | |
| 69 | .folder-popup-footer:after { |
| 70 | content: ""; |
| 71 | display: table; |
| 72 | clear: both; |
| 73 | } |
| 74 | |
| 75 | .action-btns { |
| 76 | float: right; |
| 77 | } |
| 78 | |
| 79 | .folder-anonymous { |
| 80 | display: none; |
| 81 | } |
| 82 | |
| 83 | .attention, .error-message { |
| 84 | color: red; |
| 85 | font-weight: 600; |
| 86 | display: none; |
| 87 | } |
| 88 | |
| 89 | .folder-spinner { |
| 90 | display: none; |
| 91 | } |
| 92 | |
| 93 | .folder-spinner img { |
| 94 | margin-top: 3px; |
| 95 | } |
| 96 | |
| 97 | .folder-hidden-input { |
| 98 | padding: 10px 0 0; |
| 99 | display: none; |
| 100 | } |
| 101 | |
| 102 | .folder-hidden-input input[type='text'] { |
| 103 | padding: 0 10px; |
| 104 | width: 100%; |
| 105 | height: 26px; |
| 106 | line-height: 26px; |
| 107 | } |
| 108 | |
| 109 | .folder-hidden-input textarea { |
| 110 | padding: 10px; |
| 111 | width: 100%; |
| 112 | height: 100px; |
| 113 | margin: 0 0 10px 0; |
| 114 | } |
| 115 | |
| 116 | span.folder-error-message { |
| 117 | color: #dd0000; |
| 118 | font-weight: 600; |
| 119 | } |
| 120 | |
| 121 | .form-control textarea { |
| 122 | width: 100%; |
| 123 | height: 100px; |
| 124 | margin-bottom: 10px; |
| 125 | } |
| 126 | |
| 127 | |
| 128 | .folder-help-btn { |
| 129 | position: fixed; |
| 130 | right: 20px; |
| 131 | bottom: 20px; |
| 132 | z-index: 1001 |
| 133 | } |
| 134 | |
| 135 | .folder-help-btn a { |
| 136 | display: block; |
| 137 | border: 3px solid #FFF; |
| 138 | width: 50px; |
| 139 | height: 50px; |
| 140 | -webkit-border-radius: 50%; |
| 141 | -moz-border-radius: 50%; |
| 142 | border-radius: 50%; |
| 143 | position: relative |
| 144 | } |
| 145 | |
| 146 | .folder-help-btn a img { |
| 147 | width: 100%; |
| 148 | height: auto; |
| 149 | display: block; |
| 150 | -webkit-border-radius: 50%; |
| 151 | -moz-border-radius: 50%; |
| 152 | border-radius: 50% |
| 153 | } |
| 154 | |
| 155 | .folder-help-form { |
| 156 | position: fixed; |
| 157 | right: 85px; |
| 158 | border: 1px solid #e9edf0; |
| 159 | bottom: 25px; |
| 160 | background: #fff; |
| 161 | -webkit-border-radius: 10px; |
| 162 | -moz-border-radius: 10px; |
| 163 | border-radius: 10px; |
| 164 | width: 320px; |
| 165 | z-index: 1001; |
| 166 | direction: ltr; |
| 167 | opacity: 0; |
| 168 | transition: .4s; |
| 169 | -webkit-transition: .4s; |
| 170 | -moz-transition: .4s; |
| 171 | display: none; |
| 172 | } |
| 173 | |
| 174 | .folder-help-form.active { |
| 175 | opacity: 1; |
| 176 | pointer-events: inherit; |
| 177 | display: block; |
| 178 | } |
| 179 | |
| 180 | .folder-help-header { |
| 181 | background: #f4f4f4; |
| 182 | border-bottom: solid 1px #e9edf0; |
| 183 | padding: 5px 20px; |
| 184 | -webkit-border-radius: 10px; |
| 185 | -moz-border-radius: 10px; |
| 186 | border-radius: 10px 10px 0 0; |
| 187 | font-size: 16px; |
| 188 | text-align: right |
| 189 | } |
| 190 | |
| 191 | .folder-help-header b { |
| 192 | float: left |
| 193 | } |
| 194 | |
| 195 | .folder-help-content { |
| 196 | margin-bottom: 10px; |
| 197 | padding: 20px 20px 10px |
| 198 | } |
| 199 | |
| 200 | .folder-help-form p { |
| 201 | margin: 0 0 1em |
| 202 | } |
| 203 | |
| 204 | .folder-form-field { |
| 205 | margin-bottom: 10px |
| 206 | } |
| 207 | |
| 208 | .folder-form-field input, .folder-form-field textarea { |
| 209 | -webkit-border-radius: 5px; |
| 210 | -moz-border-radius: 5px; |
| 211 | border-radius: 5px; |
| 212 | padding: 5px; |
| 213 | width: 100%; |
| 214 | box-sizing: border-box; |
| 215 | border: 1px solid #c5c5c5 |
| 216 | } |
| 217 | |
| 218 | .folder-form-field textarea { |
| 219 | width: 100%; |
| 220 | height: 100px; |
| 221 | margin-bottom: 10px; |
| 222 | } |
| 223 | |
| 224 | .folder-help-button { |
| 225 | border: none; |
| 226 | padding: 8px 0; |
| 227 | width: 100%; |
| 228 | background: #ff6624; |
| 229 | color: #fff; |
| 230 | border-radius: 18px |
| 231 | } |
| 232 | |
| 233 | .folder-help-form .error-message { |
| 234 | font-weight: 400; |
| 235 | font-size: 14px; |
| 236 | display: block; |
| 237 | } |
| 238 | |
| 239 | .folder-help-form input.input-error, .folder-help-form textarea.input-error { |
| 240 | border-color: #dc3232 |
| 241 | } |
| 242 | |
| 243 | .folder-help-btn span.tooltiptext { |
| 244 | position: absolute; |
| 245 | background: #000; |
| 246 | font-size: 12px; |
| 247 | color: #fff; |
| 248 | top: -35px; |
| 249 | width: 140%; |
| 250 | text-align: center; |
| 251 | left: -20%; |
| 252 | border-radius: 5px; |
| 253 | direction: ltr |
| 254 | } |
| 255 | |
| 256 | p.error-p, p.success-p { |
| 257 | margin: 0; |
| 258 | font-size: 14px; |
| 259 | text-align: center |
| 260 | } |
| 261 | |
| 262 | .folder-help-btn span.tooltiptext:after { |
| 263 | bottom: -20px; |
| 264 | content: ""; |
| 265 | transform: translateX(-50%); |
| 266 | height: 10px; |
| 267 | width: 0px; |
| 268 | border-width: 10px 5px 0; |
| 269 | border-style: solid; |
| 270 | border-color: #000 transparent transparent; |
| 271 | left: 50%; |
| 272 | position: absolute |
| 273 | } |
| 274 | .folder-help-btn { |
| 275 | display: none; |
| 276 | } |
| 277 | |
| 278 | p.success-p { |
| 279 | color: green |
| 280 | } |
| 281 | |
| 282 | p.error-p { |
| 283 | color: #dc3232 |
| 284 | } |
| 285 | |
| 286 | html[dir=rtl] .folder-help-btn { |
| 287 | left: 20px; |
| 288 | right: auto |
| 289 | } |
| 290 | |
| 291 | html[dir=rtl] .folder-help-form { |
| 292 | left: 85px; |
| 293 | right: auto |
| 294 | } |
| 295 | .folder-popup-body h3 { |
| 296 | line-height: 24px; |
| 297 | } |
| 298 | .folder-popup-overlay .form-control input { |
| 299 | width: 100%; |
| 300 | margin: 0 0 15px 0; |
| 301 | } |
| 302 | </style> |
| 303 | |
| 304 | <div class="folder-popup-overlay"> |
| 305 | <div class="folder-serveypanel"> |
| 306 | <form action="#" method="post" id="folder-deactivate-form"> |
| 307 | <div class="folder-popup-header"> |
| 308 | <h2><?php esc_html_e('Quick feedback about Folders', WCP_FOLDER); ?> 🙏</h2> |
| 309 | </div> |
| 310 | <div class="folder-popup-body"> |
| 311 | <h3><?php esc_html_e('Your feedback will help us improve the product, please tell us why did you decide to deactivate Folders :)', WCP_FOLDER); ?></h3> |
| 312 | <div class="form-control"> |
| 313 | <input type="email" value="<?php echo get_option( 'admin_email' ) ?>" placeholder="<?php echo _e("Email address", WCP_FOLDER) ?>" id="folder-deactivate-email_id"> |
| 314 | </div> |
| 315 | <div class="form-control"> |
| 316 | <label></label> |
| 317 | <textarea placeholder="<?php esc_html_e("Your comment", WCP_FOLDER) ?>" id="folder-comment"></textarea> |
| 318 | </div> |
| 319 | <?php esc_html_e("Having any problem with the Folders plugins?", WCP_FOLDER) ?><a class='folder-deactivate-button' href='javascript:;'><?php esc_html_e("Click here", WCP_FOLDER) ?></a><?php esc_html_e(" to contact our support now", WCP_FOLDER) ?> |
| 320 | </div> |
| 321 | <div class="folder-popup-footer"> |
| 322 | <label class="folder-anonymous"><input type="checkbox"/><?php esc_html_e('Anonymous feedback', WCP_FOLDER); ?> |
| 323 | </label> |
| 324 | <input type="button" class="button button-secondary button-skip folder-popup-skip-feedback" value="Skip & Deactivate"> |
| 325 | |
| 326 | <div class="action-btns"> |
| 327 | <span class="folder-spinner"> |
| 328 | <img src="<?php echo esc_url(admin_url('/images/spinner.gif')); ?>" alt=""> |
| 329 | </span> |
| 330 | <input type="submit" class="button button-secondary button-deactivate folder-popup-allow-deactivate" value="Submit & Deactivate" disabled="disabled"> |
| 331 | <a href="#" class="button button-primary folder-popup-button-close"><?php esc_attr_e('Cancel', WCP_FOLDER); ?></a> |
| 332 | </div> |
| 333 | </div> |
| 334 | </form> |
| 335 | </div> |
| 336 | </div> |
| 337 | |
| 338 | |
| 339 | <script> |
| 340 | (function ($) { |
| 341 | |
| 342 | $(function () { |
| 343 | |
| 344 | $(document).on("click", ".folder-deactivate-button", function(e){ |
| 345 | e.stopPropagation(); |
| 346 | jQuery(".folder-popup-button-close").trigger("click"); |
| 347 | jQuery(".folder-help-btn").toggle(); |
| 348 | jQuery(".folder-help-form").toggleClass("active"); |
| 349 | jQuery("#user_email").focus(); |
| 350 | }); |
| 351 | |
| 352 | /* Diffrent folder slug for Free/Pro */ |
| 353 | var folderPluginSlug = 'folders'; |
| 354 | // Code to fire when the DOM is ready. |
| 355 | |
| 356 | $(document).on('click', 'tr[data-slug="' + folderPluginSlug + '"] .deactivate', function (e) { |
| 357 | e.preventDefault(); |
| 358 | |
| 359 | $('.folder-popup-overlay').addClass('folder-active'); |
| 360 | $('body').addClass('folder-hidden'); |
| 361 | }); |
| 362 | $(document).on('click', '.folder-popup-button-close', function () { |
| 363 | close_popup(); |
| 364 | }); |
| 365 | $(document).on('click', ".folder-serveypanel,tr[data-slug='" + folderPluginSlug + "'] .deactivate", function (e) { |
| 366 | e.stopPropagation(); |
| 367 | }); |
| 368 | |
| 369 | $(document).click(function () { |
| 370 | close_popup(); |
| 371 | }); |
| 372 | $(document).on("keyup", "#folder-comment", function(){ |
| 373 | if($.trim($(this).val()) == "") { |
| 374 | $(".folder-popup-allow-deactivate").attr("disabled", true); |
| 375 | } else { |
| 376 | $(".folder-popup-allow-deactivate").attr("disabled", false); |
| 377 | } |
| 378 | }); |
| 379 | $(document).on('submit', '#folder-deactivate-form', function (event) { |
| 380 | event.preventDefault(); |
| 381 | |
| 382 | var _reason = jQuery('#folder-comment').val(); |
| 383 | var _email_id = jQuery('#folder-deactivate-email_id').val(); |
| 384 | |
| 385 | $.ajax({ |
| 386 | url: ajaxurl, |
| 387 | type: 'POST', |
| 388 | data: { |
| 389 | action: 'folder_plugin_deactivate', |
| 390 | reason: _reason, |
| 391 | email_id: _email_id, |
| 392 | nonce: '<?php echo esc_attr(wp_create_nonce('wcp_folder_deactivate_nonce')) ?>' |
| 393 | }, |
| 394 | beforeSend: function () { |
| 395 | $(".folder-spinner").show(); |
| 396 | $(".folder-popup-allow-deactivate").attr("disabled", "disabled"); |
| 397 | } |
| 398 | }).done(function (res) { |
| 399 | $(".folder-spinner").hide(); |
| 400 | $(".folder-popup-allow-deactivate").removeAttr("disabled"); |
| 401 | window.location.href = $("tr[data-slug='" + folderPluginSlug + "'] .deactivate a").attr('href'); |
| 402 | }); |
| 403 | }); |
| 404 | |
| 405 | $('.folder-popup-skip-feedback').on('click', function (e) { |
| 406 | window.location.href = $("tr[data-slug='" + folderPluginSlug + "'] .deactivate a").attr('href'); |
| 407 | }); |
| 408 | |
| 409 | function close_popup() { |
| 410 | $('.folder-popup-overlay').removeClass('folder-active'); |
| 411 | $('#folder-deactivate-form').trigger("reset"); |
| 412 | $(".folder-popup-allow-deactivate").attr('disabled', 'disabled'); |
| 413 | $(".folder-reason-input").hide(); |
| 414 | $('body').removeClass('folder-hidden'); |
| 415 | $('.message.error-message').hide(); |
| 416 | } |
| 417 | }); |
| 418 | |
| 419 | })(jQuery); // This invokes the function above and allows us to use '$' in place of 'jQuery' in our code. |
| 420 | </script> |
| 421 | <?php include_once dirname(__FILE__)."/help.php" ?> |