PluginProbe
WP Database Backup – Unlimited Database & Files Backup by Backup for WP / 6.12
WP Database Backup – Unlimited Database & Files Backup by Backup for WP v6.12
7.13 7.12 trunk 1.1 2.1.1 5.9 6.0 6.1 6.10 6.11 6.12 6.12.1 6.2 6.3 6.4 6.5 6.5.1 6.6 6.7 6.8 6.9 7.0 7.0.1 7.1 7.10 All 34 releases
wp-database-backup / assets / js / make-better-admin.js

make-better-admin.js in WP Database Backup – Unlimited Database & Files Backup by Backup for WP 6.12, at assets/js/make-better-admin.js

83 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var strict;
2
3 jQuery(document).ready(function ($) {
4 /**
5 * DEACTIVATION FEEDBACK FORM
6 */
7 // show overlay when clicked on "deactivate"
8 wpdbbkp_deactivate_link = $('.wp-admin.plugins-php tr[data-slug="wp-database-backup"] .row-actions .deactivate a');
9 wpdbbkp_deactivate_link_url = wpdbbkp_deactivate_link.attr('href');
10
11 wpdbbkp_deactivate_link.click(function (e) {
12 e.preventDefault();
13
14 // only show feedback form once per 30 days
15 var c_value = wpdbbkp_admin_get_cookie("wpdbbkp_hide_deactivate_feedback");
16
17 if (c_value === undefined) {
18 $('#wpdbbkp-feedback-overlay').show();
19 } else {
20 // click on the link
21 window.location.href = wpdbbkp_deactivate_link_url;
22 }
23 });
24 // show text fields
25 $('#wpdbbkp-feedback-content input[type="radio"]').click(function () {
26 // show text field if there is one
27 var input_value = $(this).attr("value");
28 var target_box = $("." + input_value);
29 $(".mb-box").not(target_box).hide();
30 $(target_box).show();
31 });
32 // send form or close it
33 $('#wpdbbkp-feedback-content .button').click(function (e) {
34 e.preventDefault();
35 // set cookie for 30 days
36 var exdate = new Date();
37 exdate.setSeconds(exdate.getSeconds() + 2592000);
38 document.cookie = "wpdbbkp_hide_deactivate_feedback=1; expires=" + exdate.toUTCString() + "; path=/";
39
40 $('#wpdbbkp-feedback-overlay').hide();
41 if ('wpdbbkp-feedback-submit' === this.id) {
42 // Send form data
43 $.ajax({
44 type: 'POST',
45 url: ajaxurl,
46 dataType: 'json',
47 data: {
48 action: 'wpdbbkp_send_feedback',
49 data: $('#wpdbbkp-feedback-content form').serialize(),
50 gn_security_nonce:gn_pub_script_vars.nonce
51 },
52 complete: function (MLHttpRequest, textStatus, errorThrown) {
53 // deactivate the plugin and close the popup
54 $('#wpdbbkp-feedback-overlay').remove();
55 window.location.href = wpdbbkp_deactivate_link_url;
56
57 }
58 });
59 } else {
60 $('#wpdbbkp-feedback-overlay').remove();
61 window.location.href = wpdbbkp_deactivate_link_url;
62 }
63 });
64 // close form without doing anything
65 $('.wpdbbkp-feedback-not-deactivate').click(function (e) {
66 $('#wpdbbkp-feedback-overlay').hide();
67 });
68
69 function wpdbbkp_admin_get_cookie (name) {
70 var i, x, y, wpdbbkp_cookies = document.cookie.split( ";" );
71 for (i = 0; i < wpdbbkp_cookies.length; i++)
72 {
73 x = wpdbbkp_cookies[i].substr( 0, wpdbbkp_cookies[i].indexOf( "=" ) );
74 y = wpdbbkp_cookies[i].substr( wpdbbkp_cookies[i].indexOf( "=" ) + 1 );
75 x = x.replace( /^\s+|\s+$/g, "" );
76 if (x === name)
77 {
78 return unescape( y );
79 }
80 }
81 }
82
83 }); // document ready