From a45e4199267d5fea618c926aace9084db2f7c534 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 15 Nov 2016 20:42:30 +0000 Subject: [PATCH] Text Changes: Unify permission error message in `wp-ajax-response.js`. See #34521. Built from https://develop.svn.wordpress.org/trunk@39253 git-svn-id: http://core.svn.wordpress.org/trunk@39193 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/wp-ajax-response.js | 2 +- wp-includes/js/wp-ajax-response.min.js | 2 +- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/js/wp-ajax-response.js b/wp-includes/js/wp-ajax-response.js index d35632102b..50c66525af 100644 --- a/wp-includes/js/wp-ajax-response.js +++ b/wp-includes/js/wp-ajax-response.js @@ -56,7 +56,7 @@ var wpAjax = jQuery.extend( { selector = jQuery( selector ); return !wpAjax.invalidateForm( selector.find('.form-required').filter( function() { return jQuery('input:visible', this).val() === ''; } ) ).length; } -}, wpAjax || { noPerm: 'You do not have permission to do that.', broken: 'An unidentified error has occurred.' } ); +}, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'An unidentified error has occurred.' } ); // Basic form validation jQuery(document).ready( function($){ diff --git a/wp-includes/js/wp-ajax-response.min.js b/wp-includes/js/wp-ajax-response.min.js index 51a3503ca6..5f1ed66444 100644 --- a/wp-includes/js/wp-ajax-response.min.js +++ b/wp-includes/js/wp-ajax-response.min.js @@ -1 +1 @@ -var wpAjax=jQuery.extend({unserialize:function(a){var b,c,d,e,f={};if(!a)return f;b=a.split("?"),b[1]&&(a=b[1]),c=a.split("&");for(d in c)jQuery.isFunction(c.hasOwnProperty)&&!c.hasOwnProperty(d)||(e=c[d].split("="),f[e[0]]=e[1]);return f},parseAjaxResponse:function(a,b,c){var d={},e=jQuery("#"+b).empty(),f="";return a&&"object"==typeof a&&a.getElementsByTagName("wp_ajax")?(d.responses=[],d.errors=!1,jQuery("response",a).each(function(){var b,e=jQuery(this),g=jQuery(this.firstChild);b={action:e.attr("action"),what:g.get(0).nodeName,id:g.attr("id"),oldId:g.attr("old_id"),position:g.attr("position")},b.data=jQuery("response_data",g).text(),b.supplemental={},jQuery("supplemental",g).children().each(function(){b.supplemental[this.nodeName]=jQuery(this).text()}).length||(b.supplemental=!1),b.errors=[],jQuery("wp_error",g).each(function(){var e,g,h,i=jQuery(this).attr("code");e={code:i,message:this.firstChild.nodeValue,data:!1},g=jQuery('wp_error_data[code="'+i+'"]',a),g&&(e.data=g.get()),h=jQuery("form-field",g).text(),h&&(i=h),c&&wpAjax.invalidateForm(jQuery("#"+c+' :input[name="'+i+'"]').parents(".form-field:first")),f+="

"+e.message+"

",b.errors.push(e),d.errors=!0}).length||(b.errors=!1),d.responses.push(b)}),f.length&&e.html('
'+f+"
"),d):isNaN(a)?!e.html('

'+a+"

"):(a=parseInt(a,10),-1==a?!e.html('

'+wpAjax.noPerm+"

"):0!==a||!e.html('

'+wpAjax.broken+"

"))},invalidateForm:function(a){return jQuery(a).addClass("form-invalid").find("input").one("change wp-check-valid-field",function(){jQuery(this).closest(".form-invalid").removeClass("form-invalid")})},validateForm:function(a){return a=jQuery(a),!wpAjax.invalidateForm(a.find(".form-required").filter(function(){return""===jQuery("input:visible",this).val()})).length}},wpAjax||{noPerm:"You do not have permission to do that.",broken:"An unidentified error has occurred."});jQuery(document).ready(function(a){a("form.validate").submit(function(){return wpAjax.validateForm(a(this))})}); \ No newline at end of file +var wpAjax=jQuery.extend({unserialize:function(a){var b,c,d,e,f={};if(!a)return f;b=a.split("?"),b[1]&&(a=b[1]),c=a.split("&");for(d in c)jQuery.isFunction(c.hasOwnProperty)&&!c.hasOwnProperty(d)||(e=c[d].split("="),f[e[0]]=e[1]);return f},parseAjaxResponse:function(a,b,c){var d={},e=jQuery("#"+b).empty(),f="";return a&&"object"==typeof a&&a.getElementsByTagName("wp_ajax")?(d.responses=[],d.errors=!1,jQuery("response",a).each(function(){var b,e=jQuery(this),g=jQuery(this.firstChild);b={action:e.attr("action"),what:g.get(0).nodeName,id:g.attr("id"),oldId:g.attr("old_id"),position:g.attr("position")},b.data=jQuery("response_data",g).text(),b.supplemental={},jQuery("supplemental",g).children().each(function(){b.supplemental[this.nodeName]=jQuery(this).text()}).length||(b.supplemental=!1),b.errors=[],jQuery("wp_error",g).each(function(){var e,g,h,i=jQuery(this).attr("code");e={code:i,message:this.firstChild.nodeValue,data:!1},g=jQuery('wp_error_data[code="'+i+'"]',a),g&&(e.data=g.get()),h=jQuery("form-field",g).text(),h&&(i=h),c&&wpAjax.invalidateForm(jQuery("#"+c+' :input[name="'+i+'"]').parents(".form-field:first")),f+="

"+e.message+"

",b.errors.push(e),d.errors=!0}).length||(b.errors=!1),d.responses.push(b)}),f.length&&e.html('
'+f+"
"),d):isNaN(a)?!e.html('

'+a+"

"):(a=parseInt(a,10),-1==a?!e.html('

'+wpAjax.noPerm+"

"):0!==a||!e.html('

'+wpAjax.broken+"

"))},invalidateForm:function(a){return jQuery(a).addClass("form-invalid").find("input").one("change wp-check-valid-field",function(){jQuery(this).closest(".form-invalid").removeClass("form-invalid")})},validateForm:function(a){return a=jQuery(a),!wpAjax.invalidateForm(a.find(".form-required").filter(function(){return""===jQuery("input:visible",this).val()})).length}},wpAjax||{noPerm:"Sorry, you are not allowed to do that.",broken:"An unidentified error has occurred."});jQuery(document).ready(function(a){a("form.validate").submit(function(){return wpAjax.validateForm(a(this))})}); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index 0e8bb7d5f8..de0d6c0418 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta3-39252'; +$wp_version = '4.7-beta3-39253'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.