X-Git-Url: http://git.cyclocoop.org/?p=ptitvelo%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fprive%2Fjavascript%2FajaxCallback.js;h=3cece6ef3d06f3f7ed9ae803588419d37e238fae;hp=8d5d7a0752a1df8c4c17eed83c85ded1bd66dc4d;hb=d18fcb8f27a4016e3fa7b50a9b2255d529dca543;hpb=e847eea4a82a7396dd0abf860f9b30d654f38629 diff --git a/www/prive/javascript/ajaxCallback.js b/www/prive/javascript/ajaxCallback.js index 8d5d7a0..3cece6e 100644 --- a/www/prive/javascript/ajaxCallback.js +++ b/www/prive/javascript/ajaxCallback.js @@ -136,7 +136,7 @@ jQuery.fn.positionner = function(force, setfocus) { jQuery.spip.virtualbuffer_id='spip_virtualbufferupdate'; jQuery.spip.initReaderBuffer = function(){ if (jQuery('#'+jQuery.spip.virtualbuffer_id).length) return; - jQuery('body').append('

'); + jQuery('body').append('

'); } jQuery.spip.updateReaderBuffer = function(){ var i = jQuery('#'+jQuery.spip.virtualbuffer_id); @@ -151,7 +151,9 @@ jQuery.fn.formulaire_setARIA = function(){ // eviter une double execution du js au moment de sa reinsertion dans le DOM par wrap() // cf http://bugs.jquery.com/ticket/7447 this.find('script').remove(); - this.wrap('
'); + this.wrap('
'); + // dans un formulaire, le screen reader relit tout a chaque saisie d'un caractere si on est en aria-live + jQuery('form',this).not('[aria-live]').attr('aria-live','off'); } return this; } @@ -647,7 +649,12 @@ jQuery.fn.ajaxbloc = function() { if (jQuery.spip.ajaxReload(blocfrag,options)) // don't trig reload of parent blocks event.stopPropagation(); - }).addClass('bind-ajaxReload'); + }).addClass('bind-ajaxReload') + .attr('aria-live','polite').attr('aria-atomic','true'); + + // dans un formulaire, le screen reader relit tout a chaque saisie d'un caractere si on est en aria-live + // mettre un aria-live="off" sur les forms inclus dans ce bloc aria-live="polite" + jQuery('form',this).not('[aria-live]').attr('aria-live','off'); jQuery(ajaxbloc_selecteur,this).not('.noajax,.bind-ajax') .click(function(){return jQuery.spip.ajaxClick(blocfrag,this.href,{force:jQuery(this).is('.nocache'),history:!(jQuery(this).is('.nohistory')||jQuery(this).closest('.box_modalbox').length)});})