![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[site community profile]](https://www.dreamwidth.org/img/comm_staff.png)
Change "Expand" alt text on cut tag icon to "Collapse"
Title:
Change "Expand" alt text on cut tag icon to "Collapse"
Area:
accessibility, images
Summary:
Change the alt text on the right-pointing arrow on a cut tag from "Expand" to "Collapse" once the user has clicked on the tag or arrow and expanded the cut tag.
Description:
I browse the site with images off, and sometimes I get confused if I've expanded a cut tag or not because the alt text for the cut tag icon reads "Expand" no matter what state the cut tag is in. If the alt text is changed to "Collapse" when the cut tag is expanded, it will hopefully improve accessibility for people who browse the site without images.
Possible drawbacks: I'm not actually sure how this would work in a screenreader.
This suggestion:
Should be implemented as-is.
40 (72.7%)
Should be implemented with changes. (please comment)
1 (1.8%)
Shouldn't be implemented.
0 (0.0%)
(I have no opinion)
12 (21.8%)
(Other: please comment)
2 (3.6%)
no subject
no subject
no subject
no subject
no subject
no subject
I don't recall the behavior on Voiceover, will check when I change devices.
no subject
Expand/Expaning/Collapse all show up.
The title attribute (which changes the tooltip text in most browsers) also worked correctly.
In Chrome, because Chrome thinks you don't want the alt text when images are turned off, I don't see anything helpful. I believe Safari does this too.
I also tested this on the OPs journal in their style and everything worked as it should, or in Chrome's case, shouldn't.
Is this a bug in the method the OP is using to turn off images?
I also have a JavaScript bookmarklet that removes the image and gives the link text matching the alt text. This worked correctly too, but if the OP has a script plugin removing the images, perhaps it isn't designed to update the image text correctly.
no subject
For both Firefox 19.0.2 and Chrome 25.0.1364.172 m in Windows 7, if I use the zap images bookmarklet from https://www.squarefree.com/bookmarklets/zap.html, the arrow will have "Collapse" if I zap images after I've already expanded the cut. If I expand it after I've zapped images, it displays "Expand" and doesn't change to "Collapse." This also happens with Chrome (forgot what version, work computer) in Windows XP.
Feel free to delete if it's some weird thing with the bookmarklet.
no subject
no subject
no subject
The way this will fix this particular problem is that if anything on the page has changed, if there had been any kind of dynamic page rewriting without reloading, you can just toggle this app images bookmarklet off and then back on and it will recognize the new alt text.
I've tested in Firefox but not chrome.
here's how to try it yourself, at least in Firefox. Take the code chunk that I am pasting at the bottom of this comment, and copy it into your buffer. In Firefox, right click on the zap images bookmarklet and select "properties". The second field you get in that window should be "location". Paste what you have in your buffer into the location field, and that should be all you need to do; Just click "save".
(make sure when you copy and paste You don't get linebreaks/whitespace. If you do, you should be able to grab the raw code.)
javascript:(function(){%20function%20toArray%20(c){%20var%20a,%20k;%20a=new%20Array;%20for%20(k=0;%20k%20<%20c.length;%20++k)a[k]=c[k];return%20a;%20}%20var%20images,%20img;%20images=toArray(document.images);%20for%20(var%20i=0;%20i%20<%20images.length;%20++i)%20{%20img=images[i];%20if(images[0].className.indexOf("zapimages")!=-1)%20{%20var%20alts=document.querySelectorAll('.zapimagesalt');%20var%20elementsToRemove%20=%20[];%20for(var%20j%20=%200;%20j%20<%20alts.length;%20j++)%20{%20alts[j].parentNode.removeChild(alts[j]);%20}%20img.style.display%20=%20img.style.display.replace(/none/,'');%20img.className%20=%20img.className.replace(/zapimages/g,%20'');%20}%20else%20{%20var%20altText=%20document.createElement("span");%20altText.innerHTML=img.alt;%20altText.className%20=%20"zapimagesalt";%20img.className%20=%20img.className%20+%20"%20zapimages";%20img.style.display="none";%20img.parentNode.insertBefore(altText,img);%20}%20}%20})();
I'm not sure if the maintainer of that page is still keeping things up to date but I might send him this code if it works for people.
no subject
no subject
no subject