Settings, password field: Fix placement of the error icon and removal of the error class.

Merge of [34068] to the 4.3 branch.

Props liljimmi, adamsilverstein.
See #33406.
Built from https://develop.svn.wordpress.org/branches/4.3@34119


git-svn-id: http://core.svn.wordpress.org/branches/4.3@34087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2015-09-14 13:07:23 +00:00
parent cca265971e
commit 12b08da9c2
8 changed files with 32 additions and 6 deletions

View File

@ -247,6 +247,19 @@ textarea[readonly] {
vertical-align: middle;
}
/* Adjust error indicator for password layout */
.form-table .form-required.user-pass1-wrap.form-invalid td:after {
content: '';
}
.form-table .form-required.user-pass1-wrap.form-invalid .password-input-wrapper:after {
content: '\f534';
font: normal 20px/1 dashicons;
color: #dc3232;
margin: 0 -29px 0 6px;
vertical-align: middle;
}
.form-input-tip {
color: #666;
}

View File

@ -247,6 +247,19 @@ textarea[readonly] {
vertical-align: middle;
}
/* Adjust error indicator for password layout */
.form-table .form-required.user-pass1-wrap.form-invalid td:after {
content: '';
}
.form-table .form-required.user-pass1-wrap.form-invalid .password-input-wrapper:after {
content: '\f534';
font: normal 20px/1 dashicons;
color: #dc3232;
margin: 0 6px 0 -29px;
vertical-align: middle;
}
.form-input-tip {
color: #666;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -50,7 +50,7 @@ var wpAjax = jQuery.extend( {
return true;
},
invalidateForm: function ( selector ) {
return jQuery( selector ).addClass( 'form-invalid' ).find('input:visible').change( function() { jQuery(this).closest('.form-invalid').removeClass( 'form-invalid' ); } );
return jQuery( selector ).addClass( 'form-invalid' ).find('input').one( 'change', function() { jQuery(this).closest('.form-invalid').removeClass( 'form-invalid' ); } );
},
validateForm: function( selector ) {
selector = jQuery( selector );

View File

@ -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()}).size()||(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+="<p>"+e.message+"</p>",b.errors.push(e),d.errors=!0}).size()||(b.errors=!1),d.responses.push(b)}),f.length&&e.html('<div class="error">'+f+"</div>"),d):isNaN(a)?!e.html('<div class="error"><p>'+a+"</p></div>"):(a=parseInt(a,10),-1==a?!e.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>"):0===a?!e.html('<div class="error"><p>'+wpAjax.broken+"</p></div>"):!0)},invalidateForm:function(a){return jQuery(a).addClass("form-invalid").find("input:visible").change(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()})).size()}},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))})});
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()}).size()||(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+="<p>"+e.message+"</p>",b.errors.push(e),d.errors=!0}).size()||(b.errors=!1),d.responses.push(b)}),f.length&&e.html('<div class="error">'+f+"</div>"),d):isNaN(a)?!e.html('<div class="error"><p>'+a+"</p></div>"):(a=parseInt(a,10),-1==a?!e.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>"):0===a?!e.html('<div class="error"><p>'+wpAjax.broken+"</p></div>"):!0)},invalidateForm:function(a){return jQuery(a).addClass("form-invalid").find("input").one("change",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()})).size()}},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))})});