WordPress/wp-admin/js/privacy-tools.min.js
Sergey Biryukov 9f12d7f575 External Libraries: First pass at fixing jQuery deprecations in WordPress core and bundled themes.
To be able to disable jQuery Migrate as step 3 of updating the jQuery version shipped with WordPress, all `JQMIGRATE` warnings in the browser console will have to be addressed.

This includes many minor adjustments to a wide array of core files.

Follow-up to:
* Step 1: Disabling jQuery Migrate 1.4.1 in WordPress 5.5: [48323], [48324]
* Step 2: Updating jQuery to 3.5.1 and adding jQuery Migrate 3.3.x in WordPress 5.6: [49101], [49338], [49615], [49649]

Props Clorith, azaozz.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@50001


git-svn-id: http://core.svn.wordpress.org/trunk@49702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-22 12:32:03 +00:00

2 lines
4.6 KiB
JavaScript

/*! This file is auto-generated */
jQuery(document).ready(function(h){var r,g=wp.i18n.__;function w(e,t){e.children().addClass("hidden"),e.children("."+t).removeClass("hidden")}function T(e){e.removeClass("has-request-results"),e.next().hasClass("request-results")&&e.next().remove()}function x(e,t,o,a){var s="",n="request-results";T(e),a.length&&(h.each(a,function(e,t){s=s+"<li>"+t+"</li>"}),s="<ul>"+s+"</ul>"),e.addClass("has-request-results"),e.hasClass("status-request-confirmed")&&(n+=" status-request-confirmed"),e.hasClass("status-request-failed")&&(n+=" status-request-failed"),e.after(function(){return'<tr class="'+n+'"><th colspan="5"><div class="notice inline notice-alt '+t+'"><p>'+o+"</p>"+s+"</div></td></tr>"})}h(".export-personal-data-handle").on("click",function(e){var t=h(this),n=t.parents(".export-personal-data"),r=t.parents("tr"),o=r.find(".export-progress"),i=t.parents(".row-actions"),d=n.data("request-id"),c=n.data("nonce"),u=n.data("exporters-count"),l=!!n.data("send-as-email");function p(e){var t=g("An error occurred while attempting to export personal data.");w(n,"export-personal-data-failed"),e&&x(r,"notice-error",t,[e]),setTimeout(function(){i.removeClass("processing")},500)}function m(e){e=0<u?e/u:0,e=Math.round(100*e).toString()+"%";o.html(e)}e.preventDefault(),e.stopPropagation(),i.addClass("processing"),n.blur(),T(r),m(0),w(n,"export-personal-data-processing"),function t(a,s){h.ajax({url:window.ajaxurl,data:{action:"wp-privacy-export-personal-data",exporter:a,id:d,page:s,security:c,sendAsEmail:l},method:"post"}).done(function(e){var o=e.data;e.success?o.done?(m(a),a<u?setTimeout(t(a+1,1)):setTimeout(function(){var e,t;e=o.url,t=g("This user&#8217;s personal data export link was sent."),void 0!==e&&(t=g("This user&#8217;s personal data export file was downloaded.")),w(n,"export-personal-data-success"),x(r,"notice-success",t,[]),void 0!==e?window.location=e:l||p(g("No personal data export file was generated.")),setTimeout(function(){i.removeClass("processing")},500)},500)):setTimeout(t(a,s+1)):setTimeout(function(){p(e.data)},500)}).fail(function(e,t,o){setTimeout(function(){p(o)},500)})}(1,1)}),h(".remove-personal-data-handle").on("click",function(e){var t=h(this),n=t.parents(".remove-personal-data"),r=t.parents("tr"),o=r.find(".erasure-progress"),i=t.parents(".row-actions"),d=n.data("request-id"),c=n.data("nonce"),u=n.data("erasers-count"),l=!1,p=!1,m=[];function f(){var e=g("An error occurred while attempting to find and erase personal data.");w(n,"remove-personal-data-failed"),x(r,"notice-error",e,[]),setTimeout(function(){i.removeClass("processing")},500)}function v(e){e=0<u?e/u:0,e=Math.round(100*e).toString()+"%";o.html(e)}e.preventDefault(),e.stopPropagation(),i.addClass("processing"),n.blur(),T(r),v(0),w(n,"remove-personal-data-processing"),function o(a,s){h.ajax({url:window.ajaxurl,data:{action:"wp-privacy-erase-personal-data",eraser:a,id:d,page:s,security:c},method:"post"}).done(function(e){var t=e.data;e.success?(t.items_removed&&(l=l||t.items_removed),t.items_retained&&(p=p||t.items_retained),t.messages&&(m=m.concat(t.messages)),t.done?(v(a),a<u?setTimeout(o(a+1,1)):setTimeout(function(){var e,t;e=g("No personal data was found for this user."),t="notice-success",w(n,"remove-personal-data-success"),!1===l?!1===p?e=g("No personal data was found for this user."):(e=g("Personal data was found for this user but was not erased."),t="notice-warning"):!1===p?e=g("All of the personal data found for this user was erased."):(e=g("Personal data was found for this user but some of the personal data found was not erased."),t="notice-warning"),x(r,t,e,m),setTimeout(function(){i.removeClass("processing")},500)},500)):setTimeout(o(a,s+1))):setTimeout(function(){f()},500)}).fail(function(){setTimeout(function(){f()},500)})}(1,1)}),h(document).on("click",function(e){var t,o,e=h(e.target),a=e.siblings(".success");if(clearTimeout(r),e.is("button.privacy-text-copy")&&(t=!(t=(e=e.parent().parent()).find("div.wp-suggested-text")).length?e.find("div.policy-text"):t).length)try{var s=document.documentElement.scrollTop,n=document.body.scrollTop;window.getSelection().removeAllRanges(),o=document.createRange(),t.addClass("hide-privacy-policy-tutorial"),o.selectNodeContents(t[0]),window.getSelection().addRange(o),document.execCommand("copy"),t.removeClass("hide-privacy-policy-tutorial"),window.getSelection().removeAllRanges(),0<s&&s!==document.documentElement.scrollTop?document.documentElement.scrollTop=s:0<n&&n!==document.body.scrollTop&&(document.body.scrollTop=n),a.addClass("visible"),wp.a11y.speak(g("The section has been copied to your clipboard.")),r=setTimeout(function(){a.removeClass("visible")},3e3)}catch(e){}})});