Version Description
- Bug fix: Correct usage of wp_localize_script arguments.
- Change: Modernization of CSS for toolbar.
- Change: Add outline offset for forced focus states.
- Change: Tweaks for font resizing stylesheets.
Download this release
Release Info
Developer | joedolson |
Plugin | WP Accessibility |
Version | 1.7.7 |
Comparing to | |
See all releases |
Code changes from version 1.7.6 to 1.7.7
- js/longdesc.button.js +3 -3
- js/longdesc.link.js +1 -1
- js/roles.jquery.js +2 -2
- readme.txt +9 -2
- toolbar/css/a11y-fontsize-alt.css +1 -1
- toolbar/css/a11y-fontsize.css +9 -5
- toolbar/css/a11y.css +25 -38
- toolbar/js/a11y.js +9 -9
- wp-accessibility-settings.php +1 -1
- wp-accessibility-toolbar.php +4 -1
- wp-accessibility.php +23 -8
js/longdesc.button.js
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
img.wrap('<div class="wpa-ld" />')
|
16 |
img.parent('.wpa-ld').addClass(classes);
|
17 |
img.parent('.wpa-ld').append('<div class="longdesc" aria-live="assertive"></div>');
|
18 |
-
img.parent('.wpa-ld').append('<button>' +
|
19 |
var container = img.parent('.wpa-ld').children('.longdesc');
|
20 |
container.hide();
|
21 |
container.load( longdesc + ' #desc_' + image_id );
|
@@ -42,7 +42,7 @@
|
|
42 |
img.wrap('<div class="wpa-ld" />')
|
43 |
img.parent('.wpa-ld').addClass(classes);
|
44 |
img.parent('.wpa-ld').append('<div class="longdesc" aria-live="assertive"></div>');
|
45 |
-
img.parent('.wpa-ld').append('<button>' +
|
46 |
var container = img.parent('.wpa-ld').children('.longdesc');
|
47 |
container.hide();
|
48 |
container.load( longdesc + ' #desc_' + image_id );
|
@@ -60,7 +60,7 @@
|
|
60 |
|
61 |
function wpa_load_image( img ) {
|
62 |
var id = img.attr( 'class' ).replace( 'wp-image-', '' );
|
63 |
-
var api = wparest + '/' + id;
|
64 |
|
65 |
$.get( api )
|
66 |
.done( function( response ) {
|
15 |
img.wrap('<div class="wpa-ld" />')
|
16 |
img.parent('.wpa-ld').addClass(classes);
|
17 |
img.parent('.wpa-ld').append('<div class="longdesc" aria-live="assertive"></div>');
|
18 |
+
img.parent('.wpa-ld').append('<button>' + wparest.text + '</button>');
|
19 |
var container = img.parent('.wpa-ld').children('.longdesc');
|
20 |
container.hide();
|
21 |
container.load( longdesc + ' #desc_' + image_id );
|
42 |
img.wrap('<div class="wpa-ld" />')
|
43 |
img.parent('.wpa-ld').addClass(classes);
|
44 |
img.parent('.wpa-ld').append('<div class="longdesc" aria-live="assertive"></div>');
|
45 |
+
img.parent('.wpa-ld').append('<button>' + wparest.text + '</button>');
|
46 |
var container = img.parent('.wpa-ld').children('.longdesc');
|
47 |
container.hide();
|
48 |
container.load( longdesc + ' #desc_' + image_id );
|
60 |
|
61 |
function wpa_load_image( img ) {
|
62 |
var id = img.attr( 'class' ).replace( 'wp-image-', '' );
|
63 |
+
var api = wparest.url + '/' + id;
|
64 |
|
65 |
$.get( api )
|
66 |
.done( function( response ) {
|
js/longdesc.link.js
CHANGED
@@ -37,7 +37,7 @@
|
|
37 |
|
38 |
function wpa_load_image( img ) {
|
39 |
var id = img.attr( 'class' ).replace( 'wp-image-', '' );
|
40 |
-
var api = wparest + '/' + id;
|
41 |
|
42 |
$.get( api )
|
43 |
.done( function( response ) {
|
37 |
|
38 |
function wpa_load_image( img ) {
|
39 |
var id = img.attr( 'class' ).replace( 'wp-image-', '' );
|
40 |
+
var api = wparest.url + '/' + id;
|
41 |
|
42 |
$.get( api )
|
43 |
.done( function( response ) {
|
js/roles.jquery.js
CHANGED
@@ -13,8 +13,8 @@
|
|
13 |
$(this).attr('role', 'contentinfo');
|
14 |
});
|
15 |
$('input[name=s]').parents('form').attr('role', 'search');
|
16 |
-
if (wpaComplementary != false) {
|
17 |
-
$('#' + wpaComplementary).each(function () {
|
18 |
$(this).attr('role', 'complementary');
|
19 |
});
|
20 |
}
|
13 |
$(this).attr('role', 'contentinfo');
|
14 |
});
|
15 |
$('input[name=s]').parents('form').attr('role', 'search');
|
16 |
+
if (wpaComplementary.container != false) {
|
17 |
+
$('#' + wpaComplementary.container).each(function () {
|
18 |
$(this).attr('role', 'complementary');
|
19 |
});
|
20 |
}
|
readme.txt
CHANGED
@@ -4,8 +4,8 @@ Donate link: http://www.joedolson.com/donate/
|
|
4 |
Tags: title, accessibility, accessible, navigation, wcag, a11y, section508, focus, alt text, labels, aria
|
5 |
Requires at least: 3.4.2
|
6 |
Requires PHP: 5.3
|
7 |
-
Tested up to: 5.
|
8 |
-
Stable tag: 1.7.
|
9 |
Text Domain: wp-accessibility
|
10 |
License: GPLv2 or later
|
11 |
|
@@ -74,6 +74,13 @@ The plug-in is intended to help with deficiencies commonly found in themes and t
|
|
74 |
|
75 |
[Suggest a change!](https://github.com/joedolson/wp-accessibility/issues/)
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
= 1.7.6 =
|
78 |
|
79 |
* Bug fix: Broken class array query in longdesc.
|
4 |
Tags: title, accessibility, accessible, navigation, wcag, a11y, section508, focus, alt text, labels, aria
|
5 |
Requires at least: 3.4.2
|
6 |
Requires PHP: 5.3
|
7 |
+
Tested up to: 5.7
|
8 |
+
Stable tag: 1.7.7
|
9 |
Text Domain: wp-accessibility
|
10 |
License: GPLv2 or later
|
11 |
|
74 |
|
75 |
[Suggest a change!](https://github.com/joedolson/wp-accessibility/issues/)
|
76 |
|
77 |
+
= 1.7.7 =
|
78 |
+
|
79 |
+
* Bug fix: Correct usage of wp_localize_script arguments.
|
80 |
+
* Change: Modernization of CSS for toolbar.
|
81 |
+
* Change: Add outline offset for forced focus states.
|
82 |
+
* Change: Tweaks for font resizing stylesheets.
|
83 |
+
|
84 |
= 1.7.6 =
|
85 |
|
86 |
* Bug fix: Broken class array query in longdesc.
|
toolbar/css/a11y-fontsize-alt.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
/* enqueue these as a separate stylesheet so they can be filtered */
|
2 |
html.fontsize {
|
3 |
-
font-size:
|
4 |
}
|
1 |
/* enqueue these as a separate stylesheet so they can be filtered */
|
2 |
html.fontsize {
|
3 |
+
font-size: 200% !important;
|
4 |
}
|
toolbar/css/a11y-fontsize.css
CHANGED
@@ -1,14 +1,18 @@
|
|
1 |
/* enqueue these as a separate stylesheet so they can be filtered */
|
2 |
-
|
3 |
.fontsize, .fontsize h1, .fontsize h2, .fontsize h3, .fontsize h4, .fontsize h5, .fontsize h6, .fontsize p, .fontsize li:not(.a11y-toolbar-list-item), .fontsize label, .fontsize input, .fontsize select, .fontsize textarea, .fontsize legend, .fontsize code, .fontsize pre, .fontsize dd, .fontsize dt, .fontsize blockquote {
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
}
|
7 |
|
|
|
8 |
.fontsize li li {
|
9 |
-
|
10 |
}
|
11 |
|
12 |
.fontsize li li li {
|
13 |
-
|
14 |
}
|
1 |
/* enqueue these as a separate stylesheet so they can be filtered */
|
|
|
2 |
.fontsize, .fontsize h1, .fontsize h2, .fontsize h3, .fontsize h4, .fontsize h5, .fontsize h6, .fontsize p, .fontsize li:not(.a11y-toolbar-list-item), .fontsize label, .fontsize input, .fontsize select, .fontsize textarea, .fontsize legend, .fontsize code, .fontsize pre, .fontsize dd, .fontsize dt, .fontsize blockquote {
|
3 |
+
font-size: 150% !important;
|
4 |
+
line-height: 1.6;
|
5 |
+
}
|
6 |
+
|
7 |
+
.fontsize h1, .fontsize h2, .fontsize h3, .fontsize h4, .fontsize h5, .fontsize h6 {
|
8 |
+
font-size: 250% !important;
|
9 |
}
|
10 |
|
11 |
+
/* Otherwise, these get larger with each level of nesting. */
|
12 |
.fontsize li li {
|
13 |
+
font-size: 110% !important;
|
14 |
}
|
15 |
|
16 |
.fontsize li li li {
|
17 |
+
font-size: 100% !important;
|
18 |
}
|
toolbar/css/a11y.css
CHANGED
@@ -49,8 +49,8 @@
|
|
49 |
list-style: none;
|
50 |
margin: 0;
|
51 |
padding: 0;
|
52 |
-
border-
|
53 |
-
border-
|
54 |
}
|
55 |
|
56 |
.a11y-toolbar ul li {
|
@@ -60,29 +60,23 @@
|
|
60 |
}
|
61 |
|
62 |
.a11y-toolbar ul li button {
|
63 |
-
font-size:
|
64 |
-
padding:
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
color: #000 !important;
|
69 |
-
}
|
70 |
-
|
71 |
-
.a11y-toolbar button.active {
|
72 |
-
color: #fff !important;
|
73 |
-
}
|
74 |
-
|
75 |
-
.a11y-toolbar ul li button {
|
76 |
-
display: block;
|
77 |
background: #e2e2e2;
|
78 |
text-align: center;
|
79 |
border-top: 1px solid #f5f5f5;
|
80 |
border-bottom: 1px solid #d2d2d2;
|
81 |
position: relative;
|
|
|
82 |
}
|
83 |
|
|
|
84 |
.a11y-toolbar ul li button:hover {
|
85 |
-
background: #
|
|
|
86 |
}
|
87 |
|
88 |
.a11y-toolbar ul li button.active {
|
@@ -91,11 +85,11 @@
|
|
91 |
}
|
92 |
|
93 |
.a11y-toolbar ul li:first-child button {
|
94 |
-
border-
|
95 |
}
|
96 |
|
97 |
.a11y-toolbar ul li:last-child button {
|
98 |
-
border-
|
99 |
}
|
100 |
|
101 |
|
@@ -110,8 +104,8 @@
|
|
110 |
height: 1px !important;
|
111 |
width: 1px !important;
|
112 |
overflow: hidden;
|
113 |
-
-
|
114 |
-
transition:
|
115 |
}
|
116 |
|
117 |
/* a11y toolbar RTL */
|
@@ -123,22 +117,17 @@
|
|
123 |
|
124 |
.a11y-toolbar.rtl ul,
|
125 |
.a11y-toolbar.right ul {
|
126 |
-
border-
|
127 |
-
border-bottom-left-radius: 4px;
|
128 |
-
border-top-right-radius: 0;
|
129 |
-
border-bottom-right-radius: 0;
|
130 |
}
|
131 |
|
132 |
.a11y-toolbar.rtl ul li:first-child button,
|
133 |
.a11y-toolbar.right ul li:first-child button {
|
134 |
-
border-
|
135 |
-
border-top-right-radius: 0;
|
136 |
}
|
137 |
|
138 |
.a11y-toolbar.rtl ul li:last-child button,
|
139 |
.a11y-toolbar.right ul li:last-child button {
|
140 |
-
border-
|
141 |
-
border-bottom-right-radius: 0;
|
142 |
}
|
143 |
|
144 |
.desaturated {
|
@@ -155,27 +144,25 @@
|
|
155 |
.a11y-toolbar button:hover .offscreen,
|
156 |
.a11y-toolbar button:focus .offscreen {
|
157 |
height: auto !important;
|
158 |
-
width:
|
159 |
clip: unset !important;
|
160 |
clip-path: unset !important;
|
161 |
color: #333;
|
162 |
-
background: #
|
163 |
-
padding:
|
164 |
box-shadow: 0 0 1px #000;
|
165 |
-
border-radius:
|
166 |
-
font-size:
|
167 |
text-transform: none;
|
168 |
font-family: Arial;
|
169 |
-
top: 25%;
|
170 |
-
display: block;
|
171 |
}
|
172 |
|
173 |
.a11y-toolbar.right button:hover .offscreen,
|
174 |
.a11y-toolbar.right button:focus .offscreen {
|
175 |
-
right:
|
176 |
left: auto;
|
177 |
}
|
178 |
|
179 |
.a11y-toolbar button:hover .offscreen, .a11y-toolbar button:focus .offscreen {
|
180 |
-
left:
|
181 |
}
|
49 |
list-style: none;
|
50 |
margin: 0;
|
51 |
padding: 0;
|
52 |
+
border-radius: 0 4px 0 0;
|
53 |
+
border-radius: 0 0 4px 0;
|
54 |
}
|
55 |
|
56 |
.a11y-toolbar ul li {
|
60 |
}
|
61 |
|
62 |
.a11y-toolbar ul li button {
|
63 |
+
font-size: 22px !important;
|
64 |
+
padding: 14px 10px;
|
65 |
+
line-height: .8;
|
66 |
+
display: grid;
|
67 |
+
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
background: #e2e2e2;
|
69 |
text-align: center;
|
70 |
border-top: 1px solid #f5f5f5;
|
71 |
border-bottom: 1px solid #d2d2d2;
|
72 |
position: relative;
|
73 |
+
color: #181818;
|
74 |
}
|
75 |
|
76 |
+
.a11y-toolbar ul li button.active,
|
77 |
.a11y-toolbar ul li button:hover {
|
78 |
+
background: #181818;
|
79 |
+
color: #fff;
|
80 |
}
|
81 |
|
82 |
.a11y-toolbar ul li button.active {
|
85 |
}
|
86 |
|
87 |
.a11y-toolbar ul li:first-child button {
|
88 |
+
border-radius: 0 4px 0 0;
|
89 |
}
|
90 |
|
91 |
.a11y-toolbar ul li:last-child button {
|
92 |
+
border-radius: 0 0 4px;
|
93 |
}
|
94 |
|
95 |
|
104 |
height: 1px !important;
|
105 |
width: 1px !important;
|
106 |
overflow: hidden;
|
107 |
+
font-size: 16px;
|
108 |
+
transition: all 200ms;
|
109 |
}
|
110 |
|
111 |
/* a11y toolbar RTL */
|
117 |
|
118 |
.a11y-toolbar.rtl ul,
|
119 |
.a11y-toolbar.right ul {
|
120 |
+
border-radius: 4px 0 0 4px;
|
|
|
|
|
|
|
121 |
}
|
122 |
|
123 |
.a11y-toolbar.rtl ul li:first-child button,
|
124 |
.a11y-toolbar.right ul li:first-child button {
|
125 |
+
border-radius: 4px 0 0 0;
|
|
|
126 |
}
|
127 |
|
128 |
.a11y-toolbar.rtl ul li:last-child button,
|
129 |
.a11y-toolbar.right ul li:last-child button {
|
130 |
+
border-radius: 0 0 0 4px;
|
|
|
131 |
}
|
132 |
|
133 |
.desaturated {
|
144 |
.a11y-toolbar button:hover .offscreen,
|
145 |
.a11y-toolbar button:focus .offscreen {
|
146 |
height: auto !important;
|
147 |
+
width: auto !important;
|
148 |
clip: unset !important;
|
149 |
clip-path: unset !important;
|
150 |
color: #333;
|
151 |
+
background: #f0f0f0;
|
152 |
+
padding: 8px 6px !important;
|
153 |
box-shadow: 0 0 1px #000;
|
154 |
+
border-radius: 3px;
|
155 |
+
font-size: 16px;
|
156 |
text-transform: none;
|
157 |
font-family: Arial;
|
|
|
|
|
158 |
}
|
159 |
|
160 |
.a11y-toolbar.right button:hover .offscreen,
|
161 |
.a11y-toolbar.right button:focus .offscreen {
|
162 |
+
right: calc( 100% + 2px );
|
163 |
left: auto;
|
164 |
}
|
165 |
|
166 |
.a11y-toolbar button:hover .offscreen, .a11y-toolbar button:focus .offscreen {
|
167 |
+
left: calc( 100% + 2px );
|
168 |
}
|
toolbar/js/a11y.js
CHANGED
@@ -12,7 +12,7 @@ function createCookie(name, value, days) {
|
|
12 |
} else {
|
13 |
var expires = '';
|
14 |
}
|
15 |
-
|
16 |
document.cookie = name + "=" + value + expires + "; path=/";
|
17 |
}
|
18 |
|
@@ -24,7 +24,7 @@ function readCookie(name) {
|
|
24 |
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
25 |
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
26 |
}
|
27 |
-
|
28 |
return null;
|
29 |
}
|
30 |
|
@@ -38,10 +38,10 @@ function eraseCookie(name) {
|
|
38 |
$('body').addClass('desaturated');
|
39 |
$('#is_normal_color').attr('id', 'is_grayscale').attr('aria-pressed', true).addClass('active');
|
40 |
}
|
41 |
-
|
42 |
if (readCookie('a11y-high-contrast')) {
|
43 |
$('body').addClass('contrast');
|
44 |
-
$('head').append($("<link href='" +
|
45 |
$('#is_normal_contrast').attr('id', 'is_high_contrast').attr('aria-pressed', true).addClass('active');
|
46 |
$('.a11y-toolbar ul li a i').addClass('icon-white');
|
47 |
}
|
@@ -50,7 +50,7 @@ function eraseCookie(name) {
|
|
50 |
$('html').addClass('fontsize');
|
51 |
$('#is_normal_fontsize').attr('id', 'is_large_fontsize').attr('aria-pressed', true).addClass('active');
|
52 |
}
|
53 |
-
|
54 |
$('.toggle-grayscale').on('click', function (e) {
|
55 |
if ($(this).attr('id') == "is_normal_color") {
|
56 |
$('body').addClass('desaturated');
|
@@ -61,13 +61,13 @@ function eraseCookie(name) {
|
|
61 |
$(this).attr('id', 'is_normal_color').attr('aria-pressed', false).removeClass('active');
|
62 |
eraseCookie('a11y-desaturated');
|
63 |
}
|
64 |
-
|
65 |
return false;
|
66 |
});
|
67 |
|
68 |
$('.toggle-contrast').on('click', function (e) {
|
69 |
if ($(this).attr('id') == "is_normal_contrast") {
|
70 |
-
$('head').append($("<link href='" +
|
71 |
$('body').addClass('contrast');
|
72 |
$(this).attr('id', 'is_high_contrast').attr('aria-pressed', true).addClass('active');
|
73 |
createCookie('a11y-high-contrast', '1');
|
@@ -77,7 +77,7 @@ function eraseCookie(name) {
|
|
77 |
$(this).attr('id', 'is_normal_contrast').attr('aria-pressed', false).removeClass('active');
|
78 |
eraseCookie('a11y-high-contrast');
|
79 |
}
|
80 |
-
|
81 |
return false;
|
82 |
});
|
83 |
|
@@ -91,7 +91,7 @@ function eraseCookie(name) {
|
|
91 |
$(this).attr('id', 'is_normal_fontsize').attr('aria-pressed', false).removeClass('active');
|
92 |
eraseCookie('a11y-larger-fontsize');
|
93 |
}
|
94 |
-
|
95 |
return false;
|
96 |
});
|
97 |
|
12 |
} else {
|
13 |
var expires = '';
|
14 |
}
|
15 |
+
|
16 |
document.cookie = name + "=" + value + expires + "; path=/";
|
17 |
}
|
18 |
|
24 |
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
25 |
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
26 |
}
|
27 |
+
|
28 |
return null;
|
29 |
}
|
30 |
|
38 |
$('body').addClass('desaturated');
|
39 |
$('#is_normal_color').attr('id', 'is_grayscale').attr('aria-pressed', true).addClass('active');
|
40 |
}
|
41 |
+
|
42 |
if (readCookie('a11y-high-contrast')) {
|
43 |
$('body').addClass('contrast');
|
44 |
+
$('head').append($("<link href='" + wpa11y.path + "' id='highContrastStylesheet' rel='stylesheet' type='text/css' />"));
|
45 |
$('#is_normal_contrast').attr('id', 'is_high_contrast').attr('aria-pressed', true).addClass('active');
|
46 |
$('.a11y-toolbar ul li a i').addClass('icon-white');
|
47 |
}
|
50 |
$('html').addClass('fontsize');
|
51 |
$('#is_normal_fontsize').attr('id', 'is_large_fontsize').attr('aria-pressed', true).addClass('active');
|
52 |
}
|
53 |
+
|
54 |
$('.toggle-grayscale').on('click', function (e) {
|
55 |
if ($(this).attr('id') == "is_normal_color") {
|
56 |
$('body').addClass('desaturated');
|
61 |
$(this).attr('id', 'is_normal_color').attr('aria-pressed', false).removeClass('active');
|
62 |
eraseCookie('a11y-desaturated');
|
63 |
}
|
64 |
+
|
65 |
return false;
|
66 |
});
|
67 |
|
68 |
$('.toggle-contrast').on('click', function (e) {
|
69 |
if ($(this).attr('id') == "is_normal_contrast") {
|
70 |
+
$('head').append($("<link href='" + wpa11y.path + "' id='highContrastStylesheet' rel='stylesheet' type='text/css' />"));
|
71 |
$('body').addClass('contrast');
|
72 |
$(this).attr('id', 'is_high_contrast').attr('aria-pressed', true).addClass('active');
|
73 |
createCookie('a11y-high-contrast', '1');
|
77 |
$(this).attr('id', 'is_normal_contrast').attr('aria-pressed', false).removeClass('active');
|
78 |
eraseCookie('a11y-high-contrast');
|
79 |
}
|
80 |
+
|
81 |
return false;
|
82 |
});
|
83 |
|
91 |
$(this).attr('id', 'is_normal_fontsize').attr('aria-pressed', false).removeClass('active');
|
92 |
eraseCookie('a11y-larger-fontsize');
|
93 |
}
|
94 |
+
|
95 |
return false;
|
96 |
});
|
97 |
|
wp-accessibility-settings.php
CHANGED
@@ -297,7 +297,7 @@ function wpa_admin_settings() {
|
|
297 |
<select name='wpa_toolbar_size' id='wpa_toolbar_size'>
|
298 |
<option value=''><?php _e( 'Default size', 'wp-accessibility' ); ?></option>
|
299 |
<?php
|
300 |
-
for ( $i = 1.
|
301 |
$val = ( $i * 10 ) + 2;
|
302 |
$current = absint( $val );
|
303 |
$selected_size = ( $current === $size ) ? ' selected="selected"' : '';
|
297 |
<select name='wpa_toolbar_size' id='wpa_toolbar_size'>
|
298 |
<option value=''><?php _e( 'Default size', 'wp-accessibility' ); ?></option>
|
299 |
<?php
|
300 |
+
for ( $i = 1.6; $i <= 3.8; ) {
|
301 |
$val = ( $i * 10 ) + 2;
|
302 |
$current = absint( $val );
|
303 |
$selected_size = ( $current === $size ) ? ' selected="selected"' : '';
|
wp-accessibility-toolbar.php
CHANGED
@@ -49,7 +49,10 @@ function wpa_toolbar_enqueue_scripts() {
|
|
49 |
if ( file_exists( get_stylesheet_directory() . '/a11y-contrast.css' ) ) {
|
50 |
$plugin_path = get_stylesheet_directory_uri() . '/a11y-contrast.css';
|
51 |
}
|
52 |
-
|
|
|
|
|
|
|
53 |
|
54 |
// Font files for toolbar.
|
55 |
wp_register_style( 'ui-font', plugins_url( 'toolbar/fonts/css/a11y-toolbar.css', __FILE__ ) );
|
49 |
if ( file_exists( get_stylesheet_directory() . '/a11y-contrast.css' ) ) {
|
50 |
$plugin_path = get_stylesheet_directory_uri() . '/a11y-contrast.css';
|
51 |
}
|
52 |
+
$plugin_path = array(
|
53 |
+
'path' => $plugin_path,
|
54 |
+
);
|
55 |
+
wp_localize_script( 'ui-a11y', 'wpa11y', $plugin_path );
|
56 |
|
57 |
// Font files for toolbar.
|
58 |
wp_register_style( 'ui-font', plugins_url( 'toolbar/fonts/css/a11y-toolbar.css', __FILE__ ) );
|
wp-accessibility.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @package WP Accessibility
|
6 |
* @author Joe Dolson
|
7 |
-
* @copyright 2012-
|
8 |
* @license GPL-2.0+
|
9 |
*
|
10 |
* @wordpress-plugin
|
@@ -17,11 +17,11 @@
|
|
17 |
* Domain Path: /lang
|
18 |
* License: GPL-2.0+
|
19 |
* License URI: http://www.gnu.org/license/gpl-2.0.txt
|
20 |
-
* Version: 1.7.
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
-
Copyright 2012-
|
25 |
|
26 |
This program is free software; you can redistribute it and/or modify
|
27 |
it under the terms of the GNU General Public License as published by
|
@@ -69,7 +69,7 @@ function wpa_admin_menu() {
|
|
69 |
* Install on activation.
|
70 |
*/
|
71 |
function wpa_install() {
|
72 |
-
$wpa_version = '1.7.
|
73 |
if ( 'true' !== get_option( 'wpa_installed' ) ) {
|
74 |
add_option( 'rta_from_nav_menu', 'on' );
|
75 |
add_option( 'rta_from_page_lists', 'on' );
|
@@ -134,6 +134,9 @@ function wpacc_enqueue_scripts() {
|
|
134 |
} else {
|
135 |
$wpa_comp = false;
|
136 |
}
|
|
|
|
|
|
|
137 |
wp_localize_script( 'wpa-complementary', 'wpaComplementary', $wpa_comp );
|
138 |
}
|
139 |
if ( 'on' === get_option( 'wpa_labels' ) ) {
|
@@ -149,12 +152,24 @@ function wpacc_enqueue_scripts() {
|
|
149 |
}
|
150 |
if ( 'link' === get_option( 'wpa_longdesc' ) ) {
|
151 |
wp_enqueue_script( 'longdesc.link', plugins_url( 'js/longdesc.link.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
152 |
-
wp_localize_script(
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
}
|
154 |
if ( 'jquery' === get_option( 'wpa_longdesc' ) ) {
|
155 |
wp_enqueue_script( 'longdesc.button', plugins_url( 'js/longdesc.button.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
156 |
-
wp_localize_script(
|
157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
159 |
wp_enqueue_script( 'current.menu', plugins_url( 'js/current-menu-item.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
160 |
}
|
@@ -245,7 +260,7 @@ function wpa_css() {
|
|
245 |
if ( 'on' === get_option( 'wpa_focus' ) ) {
|
246 |
$color = ( false !== (bool) get_option( 'wpa_focus_color' ) ) ? ' #' . get_option( 'wpa_focus_color' ) : '';
|
247 |
$styles .= "
|
248 |
-
:focus { outline: 1px solid$color!important; }
|
249 |
";
|
250 |
}
|
251 |
if ( '' !== $styles ) {
|
4 |
*
|
5 |
* @package WP Accessibility
|
6 |
* @author Joe Dolson
|
7 |
+
* @copyright 2012-2021 Joe Dolson
|
8 |
* @license GPL-2.0+
|
9 |
*
|
10 |
* @wordpress-plugin
|
17 |
* Domain Path: /lang
|
18 |
* License: GPL-2.0+
|
19 |
* License URI: http://www.gnu.org/license/gpl-2.0.txt
|
20 |
+
* Version: 1.7.7
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
+
Copyright 2012-2021 Joe Dolson (email : joe@joedolson.com)
|
25 |
|
26 |
This program is free software; you can redistribute it and/or modify
|
27 |
it under the terms of the GNU General Public License as published by
|
69 |
* Install on activation.
|
70 |
*/
|
71 |
function wpa_install() {
|
72 |
+
$wpa_version = '1.7.7';
|
73 |
if ( 'true' !== get_option( 'wpa_installed' ) ) {
|
74 |
add_option( 'rta_from_nav_menu', 'on' );
|
75 |
add_option( 'rta_from_page_lists', 'on' );
|
134 |
} else {
|
135 |
$wpa_comp = false;
|
136 |
}
|
137 |
+
$wpa_comp = array(
|
138 |
+
'container' => $wpa_comp,
|
139 |
+
);
|
140 |
wp_localize_script( 'wpa-complementary', 'wpaComplementary', $wpa_comp );
|
141 |
}
|
142 |
if ( 'on' === get_option( 'wpa_labels' ) ) {
|
152 |
}
|
153 |
if ( 'link' === get_option( 'wpa_longdesc' ) ) {
|
154 |
wp_enqueue_script( 'longdesc.link', plugins_url( 'js/longdesc.link.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
155 |
+
wp_localize_script(
|
156 |
+
'longdesc.link',
|
157 |
+
'wparest',
|
158 |
+
array(
|
159 |
+
'url' => get_rest_url( null, 'wp/v2/media' ),
|
160 |
+
)
|
161 |
+
);
|
162 |
}
|
163 |
if ( 'jquery' === get_option( 'wpa_longdesc' ) ) {
|
164 |
wp_enqueue_script( 'longdesc.button', plugins_url( 'js/longdesc.button.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
165 |
+
wp_localize_script(
|
166 |
+
'longdesc.button',
|
167 |
+
'wparest',
|
168 |
+
array(
|
169 |
+
'url' => get_rest_url( null, 'wp/v2/media' ),
|
170 |
+
'text' => '<span>' . __( 'Long Description', 'wp-accessibility' ) . '</span>',
|
171 |
+
)
|
172 |
+
);
|
173 |
}
|
174 |
wp_enqueue_script( 'current.menu', plugins_url( 'js/current-menu-item.js', __FILE__ ), array( 'jquery' ), '1.0', true );
|
175 |
}
|
260 |
if ( 'on' === get_option( 'wpa_focus' ) ) {
|
261 |
$color = ( false !== (bool) get_option( 'wpa_focus_color' ) ) ? ' #' . get_option( 'wpa_focus_color' ) : '';
|
262 |
$styles .= "
|
263 |
+
:focus { outline: 1px solid$color!important; outline-offset: 2px !important; }
|
264 |
";
|
265 |
}
|
266 |
if ( '' !== $styles ) {
|