1 line
1.8 KiB
JavaScript
1 line
1.8 KiB
JavaScript
jQuery(document).ready(function(a){a("#link_rel").prop("readonly",!0),a("#linkxfndiv input").bind("click keyup",function(){var b=a("#me").is(":checked"),c="";a("input.valinp").each(function(){b?a(this).prop("disabled",!0).parent().addClass("disabled"):(a(this).removeAttr("disabled").parent().removeClass("disabled"),a(this).is(":checked")&&""!==a(this).val()&&(c+=a(this).val()+" "))}),a("#link_rel").val(b?"me":c.substr(0,c.length-1))})}),jQuery(document).ready(function(a){function b(a,b){a.children().hide(),a.children("."+b).show()}function c(a){a.next().hasClass("request-results")&&a.next().remove()}function d(a,b,d,e){c(a),e.length,a.after(function(){return'<tr class="request-results"><td colspan="5"><div class="notice inline notice-alt '+b+'"><p>'+d+"</p></div></td></tr>"})}var e=window.privacyToolsL10n||{};a(".remove_personal_data a").click(function(f){function g(){b(k,"remove_personal_data_idle");var a=e.noDataFound,c="notice-success";0==p?0==q?a=e.noDataFound:(a=e.noneRemoved,c="notice-warning"):0==q?a=e.foundAndRemoved:(a=e.someNotRemoved,c="notice-warning"),d(l,"notice-success",a,[])}function h(){b(k,"remove_personal_data_failed"),d(l,"notice-error",e.anErrorOccurred,[])}function i(b,c){a.ajax({url:window.ajaxurl,data:{action:"wp-privacy-erase-personal-data",eraser:b,id:m,page:c,security:n},method:"post"}).done(function(a){if(!a.success)return void h();var d=a.data;d.num_items_removed&&(p+=d.num_items_removed),d.num_items_retained&&(q+=d.num_items_removed),d.messages&&(r=r.concat(d.messages)),d.done?b<o?setTimeout(i(b+1,1)):g():setTimeout(i(b,c+1))}).fail(function(){h()})}f.preventDefault(),f.stopPropagation();var j=a(this),k=j.parents(".remove_personal_data"),l=j.parents("tr"),m=k.data("request-id"),n=k.data("nonce"),o=k.data("erasers-count"),p=0,q=0,r=[];k.blur(),c(l),b(k,"remove_personal_data_processing"),i(1,1)})}); |