Privacy: Prevent unexpected scrolling when clicking the "Copy this section to clipboard" button on Privacy Policy Guide screen.
Props garrett-eclipse, birgire, davidbaumwald, pbiron. Fixes #49540. Built from https://develop.svn.wordpress.org/trunk@47420 git-svn-id: http://core.svn.wordpress.org/trunk@47207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c30fd0b54d
commit
18e3aa433c
|
@ -274,6 +274,9 @@ jQuery( document ).ready( function( $ ) {
|
|||
|
||||
if ( $container.length ) {
|
||||
try {
|
||||
var documentPosition = document.documentElement.scrollTop,
|
||||
bodyPosition = document.body.scrollTop;
|
||||
|
||||
window.getSelection().removeAllRanges();
|
||||
range = document.createRange();
|
||||
$container.addClass( 'hide-privacy-policy-tutorial' );
|
||||
|
@ -284,6 +287,12 @@ jQuery( document ).ready( function( $ ) {
|
|||
|
||||
$container.removeClass( 'hide-privacy-policy-tutorial' );
|
||||
window.getSelection().removeAllRanges();
|
||||
|
||||
if ( documentPosition > 0 && documentPosition !== document.documentElement.scrollTop ) {
|
||||
document.documentElement.scrollTop = documentPosition;
|
||||
} else if ( bodyPosition > 0 && bodyPosition !== document.body.scrollTop ) {
|
||||
document.body.scrollTop = bodyPosition;
|
||||
}
|
||||
} catch ( er ) {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
/*! This file is auto-generated */
|
||||
jQuery(document).ready(function(g){var h=window.privacyToolsL10n||{};function w(e,t){e.children().addClass("hidden"),e.children("."+t).removeClass("hidden")}function x(e){e.removeClass("has-request-results"),e.next().hasClass("request-results")&&e.next().remove()}function C(e,t,n,a){var o="",s="request-results";x(e),a.length&&(g.each(a,function(e,t){o=o+"<li>"+t+"</li>"}),o="<ul>"+o+"</ul>"),e.addClass("has-request-results"),e.hasClass("status-request-confirmed")&&(s+=" status-request-confirmed"),e.hasClass("status-request-failed")&&(s+=" status-request-failed"),e.after(function(){return'<tr class="'+s+'"><th colspan="5"><div class="notice inline notice-alt '+t+'"><p>'+n+"</p>"+o+"</div></td></tr>"})}g(".export-personal-data-handle").click(function(e){var t=g(this),s=t.parents(".export-personal-data"),r=t.parents("tr"),a=r.find(".export-progress"),i=t.parents(".row-actions"),c=s.data("request-id"),d=s.data("nonce"),u=s.data("exporters-count"),l=!!s.data("send-as-email");function p(e){w(s,"export-personal-data-failed"),e&&C(r,"notice-error",h.exportError,[e]),setTimeout(function(){i.removeClass("processing")},500)}function m(e){var t=0<u?e/u:0,n=Math.round(100*t).toString()+"%";a.html(n)}e.preventDefault(),e.stopPropagation(),i.addClass("processing"),s.blur(),x(r),m(0),w(s,"export-personal-data-processing"),function n(a,o){g.ajax({url:window.ajaxurl,data:{action:"wp-privacy-export-personal-data",exporter:a,id:c,page:o,security:d,sendAsEmail:l},method:"post"}).done(function(e){var t=e.data;e.success?t.done?(m(a),a<u?setTimeout(n(a+1,1)):setTimeout(function(){!function(e){var t=h.emailSent;w(s,"export-personal-data-success"),C(r,"notice-success",t,[]),void 0!==e?window.location=e:l||p(h.noExportFile),setTimeout(function(){i.removeClass("processing")},500)}(t.url)},500)):setTimeout(n(a,o+1)):setTimeout(function(){p(e.data)},500)}).fail(function(e,t,n){setTimeout(function(){p(n)},500)})}(1,1)}),g(".remove-personal-data-handle").click(function(e){var t=g(this),s=t.parents(".remove-personal-data"),r=t.parents("tr"),a=r.find(".erasure-progress"),i=t.parents(".row-actions"),c=s.data("request-id"),d=s.data("nonce"),u=s.data("erasers-count"),l=!1,p=!1,m=[];function f(){w(s,"remove-personal-data-failed"),C(r,"notice-error",h.removalError,[]),setTimeout(function(){i.removeClass("processing")},500)}function v(e){var t=0<u?e/u:0,n=Math.round(100*t).toString()+"%";a.html(n)}e.preventDefault(),e.stopPropagation(),i.addClass("processing"),s.blur(),x(r),v(0),w(s,"remove-personal-data-processing"),function n(a,o){g.ajax({url:window.ajaxurl,data:{action:"wp-privacy-erase-personal-data",eraser:a,id:c,page:o,security:d},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(n(a+1,1)):setTimeout(function(){!function(){var e=h.noDataFound,t="notice-success";w(s,"remove-personal-data-success"),!1===l?!1===p?e=h.noDataFound:(e=h.noneRemoved,t="notice-warning"):!1===p?e=h.foundAndRemoved:(e=h.someNotRemoved,t="notice-warning"),C(r,t,e,m),setTimeout(function(){i.removeClass("processing")},500)}()},500)):setTimeout(n(a,o+1))):setTimeout(function(){f()},500)}).fail(function(){setTimeout(function(){f()},500)})}(1,1)}),g(document).on("click",function(e){var t,n,a,o=g(e.target);if(o.is("button.privacy-text-copy")&&((n=(t=o.parent().parent()).find("div.wp-suggested-text")).length||(n=t.find("div.policy-text")),n.length))try{window.getSelection().removeAllRanges(),a=document.createRange(),n.addClass("hide-privacy-policy-tutorial"),a.selectNodeContents(n[0]),window.getSelection().addRange(a),document.execCommand("copy"),n.removeClass("hide-privacy-policy-tutorial"),window.getSelection().removeAllRanges()}catch(e){}})});
|
||||
jQuery(document).ready(function(g){var h=window.privacyToolsL10n||{};function w(e,t){e.children().addClass("hidden"),e.children("."+t).removeClass("hidden")}function x(e){e.removeClass("has-request-results"),e.next().hasClass("request-results")&&e.next().remove()}function T(e,t,o,n){var a="",s="request-results";x(e),n.length&&(g.each(n,function(e,t){a=a+"<li>"+t+"</li>"}),a="<ul>"+a+"</ul>"),e.addClass("has-request-results"),e.hasClass("status-request-confirmed")&&(s+=" status-request-confirmed"),e.hasClass("status-request-failed")&&(s+=" status-request-failed"),e.after(function(){return'<tr class="'+s+'"><th colspan="5"><div class="notice inline notice-alt '+t+'"><p>'+o+"</p>"+a+"</div></td></tr>"})}g(".export-personal-data-handle").click(function(e){var t=g(this),s=t.parents(".export-personal-data"),r=t.parents("tr"),n=r.find(".export-progress"),i=t.parents(".row-actions"),c=s.data("request-id"),d=s.data("nonce"),u=s.data("exporters-count"),l=!!s.data("send-as-email");function p(e){w(s,"export-personal-data-failed"),e&&T(r,"notice-error",h.exportError,[e]),setTimeout(function(){i.removeClass("processing")},500)}function m(e){var t=0<u?e/u:0,o=Math.round(100*t).toString()+"%";n.html(o)}e.preventDefault(),e.stopPropagation(),i.addClass("processing"),s.blur(),x(r),m(0),w(s,"export-personal-data-processing"),function o(n,a){g.ajax({url:window.ajaxurl,data:{action:"wp-privacy-export-personal-data",exporter:n,id:c,page:a,security:d,sendAsEmail:l},method:"post"}).done(function(e){var t=e.data;e.success?t.done?(m(n),n<u?setTimeout(o(n+1,1)):setTimeout(function(){!function(e){var t=h.emailSent;w(s,"export-personal-data-success"),T(r,"notice-success",t,[]),void 0!==e?window.location=e:l||p(h.noExportFile),setTimeout(function(){i.removeClass("processing")},500)}(t.url)},500)):setTimeout(o(n,a+1)):setTimeout(function(){p(e.data)},500)}).fail(function(e,t,o){setTimeout(function(){p(o)},500)})}(1,1)}),g(".remove-personal-data-handle").click(function(e){var t=g(this),s=t.parents(".remove-personal-data"),r=t.parents("tr"),n=r.find(".erasure-progress"),i=t.parents(".row-actions"),c=s.data("request-id"),d=s.data("nonce"),u=s.data("erasers-count"),l=!1,p=!1,m=[];function f(){w(s,"remove-personal-data-failed"),T(r,"notice-error",h.removalError,[]),setTimeout(function(){i.removeClass("processing")},500)}function v(e){var t=0<u?e/u:0,o=Math.round(100*t).toString()+"%";n.html(o)}e.preventDefault(),e.stopPropagation(),i.addClass("processing"),s.blur(),x(r),v(0),w(s,"remove-personal-data-processing"),function o(n,a){g.ajax({url:window.ajaxurl,data:{action:"wp-privacy-erase-personal-data",eraser:n,id:c,page:a,security:d},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(n),n<u?setTimeout(o(n+1,1)):setTimeout(function(){!function(){var e=h.noDataFound,t="notice-success";w(s,"remove-personal-data-success"),!1===l?!1===p?e=h.noDataFound:(e=h.noneRemoved,t="notice-warning"):!1===p?e=h.foundAndRemoved:(e=h.someNotRemoved,t="notice-warning"),T(r,t,e,m),setTimeout(function(){i.removeClass("processing")},500)}()},500)):setTimeout(o(n,a+1))):setTimeout(function(){f()},500)}).fail(function(){setTimeout(function(){f()},500)})}(1,1)}),g(document).on("click",function(e){var t,o,n,a=g(e.target);if(a.is("button.privacy-text-copy")&&((o=(t=a.parent().parent()).find("div.wp-suggested-text")).length||(o=t.find("div.policy-text")),o.length))try{var s=document.documentElement.scrollTop,r=document.body.scrollTop;window.getSelection().removeAllRanges(),n=document.createRange(),o.addClass("hide-privacy-policy-tutorial"),n.selectNodeContents(o[0]),window.getSelection().addRange(n),document.execCommand("copy"),o.removeClass("hide-privacy-policy-tutorial"),window.getSelection().removeAllRanges(),0<s&&s!==document.documentElement.scrollTop?document.documentElement.scrollTop=s:0<r&&r!==document.body.scrollTop&&(document.body.scrollTop=r)}catch(e){}})});
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.4-beta3-47418';
|
||||
$wp_version = '5.4-beta3-47420';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue