Skip to content

Commit

Permalink
MDL-44227 Atto: the screenreader helper now displays some texts when …
Browse files Browse the repository at this point in the history
…alt or title don\'t exist
  • Loading branch information
mouneyrac authored and Damyon Wiese committed Mar 26, 2014
1 parent e7109b5 commit 7ca3ad9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,19 @@ M.atto_accessibilityhelper = M.atto_accessibilityhelper || {
listitem, selectimage;

editable.all('img').each(function(image) {

// Get the alt or title or img url of the image.
var imgalt = image.getAttribute('alt');
if (imgalt === '') {
imgalt = image.getAttribute('title');
if (imgalt === '') {
imgalt = image.getAttribute('src');
}
}

selectimage = Y.Node.create('<a href="#" title="' +
M.util.get_string('selectimage', 'atto_accessibilityhelper') + '">' +
Y.Escape.html(image.getAttribute('alt')) +
Y.Escape.html(imgalt) +
'</a>');

selectimage.setData('sourceimage', image);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,19 @@ M.atto_accessibilityhelper = M.atto_accessibilityhelper || {
listitem, selectimage;

editable.all('img').each(function(image) {

// Get the alt or title or img url of the image.
var imgalt = image.getAttribute('alt');
if (imgalt === '') {
imgalt = image.getAttribute('title');
if (imgalt === '') {
imgalt = image.getAttribute('src');
}
}

selectimage = Y.Node.create('<a href="#" title="' +
M.util.get_string('selectimage', 'atto_accessibilityhelper') + '">' +
Y.Escape.html(image.getAttribute('alt')) +
Y.Escape.html(imgalt) +
'</a>');

selectimage.setData('sourceimage', image);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,19 @@ M.atto_accessibilityhelper = M.atto_accessibilityhelper || {
listitem, selectimage;

editable.all('img').each(function(image) {

// Get the alt or title or img url of the image.
var imgalt = image.getAttribute('alt');
if (imgalt === '') {
imgalt = image.getAttribute('title');
if (imgalt === '') {
imgalt = image.getAttribute('src');
}
}

selectimage = Y.Node.create('<a href="#" title="' +
M.util.get_string('selectimage', 'atto_accessibilityhelper') + '">' +
Y.Escape.html(image.getAttribute('alt')) +
Y.Escape.html(imgalt) +
'</a>');

selectimage.setData('sourceimage', image);
Expand Down

0 comments on commit 7ca3ad9

Please sign in to comment.