Changeset 1677780
- Timestamp:
- 06/13/2017 04:22:27 PM (7 years ago)
- Location:
- accessible-divi/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
accessible-divi/trunk/divi-accessibility.php
r1672828 r1677780 15 15 * @wordpress-plugin 16 16 * Plugin Name: Divi Accessibility 17 * Plugin URI: https:// github.com/campuspress/divi-accessibility17 * Plugin URI: https:// 18 18 * Description: Improve Divi accessibility in accordance with WCAG 2.0 guidelines. 19 19 * Version: 1.0.0 20 * Author: Joseph Fusco20 * Author: 21 21 * Author URI: https://campuspress.com 22 22 * License: GPL-2.0+ -
accessible-divi/trunk/includes/class-divi-accessibility.php
r1672828 r1677780 94 94 $this->da11y = 'divi_accessibility'; 95 95 $this->da11y_options = 'divi_accessibility_options'; 96 $this->version = '1.0. 0';96 $this->version = '1.0.'; 97 97 98 98 $this->load_dependencies(); -
accessible-divi/trunk/public/partials/divi-accessibility-embedded-css.php
r1672828 r1677780 41 41 42 42 ?> 43 *:active.keyboard-outline, 44 *:focus.keyboard-outline { 43 .keyboard-outline { 45 44 <?php 46 45 … … 59 58 button:focus.keyboard-outline, 60 59 input:active.keyboard-outline, 61 input:focus.keyboard-outline { 60 input:focus.keyboard-outline, 61 a[role="tab"].keyboard-outline { 62 62 outline-offset: -5px; 63 63 } … … 65 65 padding-left: 15px; 66 66 padding-right: 15px; 67 68 69 70 67 71 } 68 72 <?php -
accessible-divi/trunk/public/partials/divi-accessibility-embedded-js.php
r1672828 r1677780 228 228 229 229 $(document).keyup(function (e) { 230 // Enter 230 // Enter 231 231 if (e.which === 13) { 232 232 // Expand Accordion & Toggle modules when enter is hit while focused. … … 323 323 324 324 /** 325 * Add aria-selected="false". 325 * Add inital state: 326 * 327 * aria-selected="false" 328 * aria-expanded="false" 329 * tabindex=-1 326 330 * 327 331 * @divi-module Tab … … 329 333 $('.et_pb_tabs_controls li:not(.et_pb_tab_active) a').each(function () { 330 334 $(this).attr('aria-selected', 'false'); 331 }); 332 333 /** 334 * Add aria-selected="true". 335 * 336 * @divi-module Tab 335 $(this).attr('aria-expanded', 'false'); 336 $(this).attr('tabindex', -1); 337 }); 338 339 /** 340 * Add inital state: 341 * 342 * aria-selected="true" 343 * aria-expanded="true" 344 * tabindex=-1 345 * 346 * @divi-module Tab 337 347 */ 338 348 $('.et_pb_tabs_controls li.et_pb_tab_active a').each(function () { 339 349 $(this).attr('aria-selected', 'true'); 350 351 340 352 }); 341 353 … … 387 399 */ 388 400 $('.et_pb_tabs').each(function (e) { 389 $(this).attr('data- a11y-id', 'et_pb_tab_module_' + e);401 $(this).attr('data-a11y-id', 'et_pb_tab_module_' + e); 390 402 }); 391 403 … … 397 409 $('.et_pb_tabs_controls a').on('click', function () { 398 410 var id = $(this).attr('id'); 399 var namespace = $(this).closest('.et_pb_tabs').attr('data-a11y-id'); // Used as a selector to scope changes to current module. 400 401 // Reset all tab controls to be aria-selected="false". 402 $('#' + namespace + ' .et_pb_tabs_controls a').attr('aria-selected', 'false'); 403 404 // Make active tab control aria-selected="true". 405 $(this).attr('aria-selected', 'true'); 411 var namespace = $(this).closest('.et_pb_tabs').attr('data-da11y-id'); // Used as a selector to scope changes to current module. 412 413 // Reset all tab controls to be aria-selected="false" & aria-expanded="false". 414 $('[data-da11y-id="' + namespace + '"] .et_pb_tabs_controls a') 415 .attr('aria-selected', 'false') 416 .attr('aria-expanded', 'false') 417 .attr('tabindex', -1); 418 419 // Make active tab control aria-selected="true" & aria-expanded="true". 420 $(this) 421 .attr('aria-selected', 'true') 422 .attr('aria-expanded', 'true') 423 .attr('tabindex', 0); 406 424 407 425 // Reset all tabs to be aria-hidden="true". 408 $('#' + namespace + ' .et_pb_tab').attr('aria-hidden', 'true'); 426 $('#' + namespace + ' .et_pb_tab') 427 .attr('aria-hidden', 'true'); 409 428 410 429 // Label active tab panel as aria-hidden="false". 411 $('[aria-labelledby="' + id + '"]').attr('aria-hidden', 'false'); 430 $('[aria-labelledby="' + id + '"]') 431 .attr('aria-hidden', 'false'); 432 }); 433 434 // Arrow navigation for tab modules 435 $('.et_pb_tabs_controls a').keyup(function (e) { 436 var namespace = $(this).closest('.et_pb_tabs').attr('data-da11y-id'); 437 var module = $('[data-da11y-id="' + namespace + '"]'); 438 439 if (e.which === 39 || e.which === 40) { // Down & Right. 440 var next = module.find('li.et_pb_tab_active').next(); 441 442 if (next.length > 0) { 443 next.find('a').trigger('click'); 444 } else { 445 module.find('li:first a').trigger('click'); 446 } 447 } else if (e.which === 37 || e.which === 38) { // Up & Left. 448 var next = module.find('li.et_pb_tab_active').prev(); 449 450 if (next.length > 0) { 451 next.find('a').trigger('click'); 452 } else { 453 module.find('li:last a').trigger('click'); 454 } 455 } 456 457 $('.et_pb_tabs_controls a').removeClass('keyboard-outline'); 458 module.find('li.et_pb_tab_active a').addClass('keyboard-outline'); 412 459 }); 413 460 … … 419 466 */ 420 467 $('.et_pb_search').each(function (e) { 421 $(this).attr('data- a11y-id', 'et_pb_search_module_' + e);468 $(this).attr('data-a11y-id', 'et_pb_search_module_' + e); 422 469 }); 423 470 -
accessible-divi/trunk/readme.txt
r1672828 r1677780 47 47 == Changelog == 48 48 49 50 51 49 52 = 1.0.0 = 50 53 * Initial Release
Note: See TracChangeset
for help on using the changeset viewer.