Skip to content

Commit deb711b

Browse files
brendanx67claude
andcommitted
Added accessibility and docs support to tool listing page
* Added visually-hidden tool name to Download and Documentation buttons * Show Documentation button when tool has docs extracted from ZIP Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a48fb58 commit deb711b

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

SkylineToolsStore/src/org/labkey/skylinetoolsstore/view/SkylineToolsStoreWebPart.jsp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@
153153
// Get supporting files in map <url, icon url>
154154
HashMap<String, String> suppFiles = SkylineToolsStoreController.getSupplementaryFiles(tool);
155155
Iterator suppIter = suppFiles.entrySet().iterator();
156+
boolean hasDocs = tool.hasDocumentation();
157+
int docCount = suppFiles.size() + (hasDocs ? 1 : 0);
156158
157159
final String curToolOwners = StringUtils.join(SkylineToolsStoreController.getToolOwners(tool), ", ");
158160
toolOwners.put(tool.getRowId(), curToolOwners);
@@ -203,14 +205,21 @@
203205
<button type="button" id="download-tool-btn-<%=tool.getRowId()%>" class="styled-button">Download <span class="visually-hidden"><%=h(tool.getName())%></span></button>
204206
<% addHandler("download-tool-btn-" + tool.getRowId(), "click", "window.location.href = " + q(urlFor(SkylineToolsStoreController.DownloadToolAction.class).addParameter("id", tool.getRowId()))); %>
205207
<%
206-
if (suppFiles.size() == 1) {
208+
if (docCount == 1 && hasDocs) {
209+
%>
210+
<a href="<%=h(tool.getDocsUrl())%>" target="_blank" rel="noopener noreferrer"><button type="button" class="styled-button">Documentation <span class="visually-hidden"><%=h(tool.getName())%></span></button></a>
211+
<%
212+
} else if (docCount == 1) {
207213
Map.Entry suppPair = (Map.Entry)suppIter.next();
208214
%>
209-
<a href="<%=h(suppPair.getKey())%>"><button type="button" class="styled-button">Documentation</button></a>
210-
<% } else if (suppFiles.size() > 1) { %>
215+
<a href="<%=h(suppPair.getKey())%>"><button type="button" class="styled-button">Documentation <span class="visually-hidden"><%=h(tool.getName())%></span></button></a>
216+
<% } else if (docCount > 1) { %>
211217
<div class="menuMouseArea">
212-
<button type="button" class="styled-button">Documentation</button>
218+
<button type="button" class="styled-button">Documentation <span class="visually-hidden"><%=h(tool.getName())%></span></button>
213219
<ul class="dropMenu">
220+
<% if (hasDocs) { %>
221+
<li><a href="<%=h(tool.getDocsUrl())%>" target="_blank" rel="noopener noreferrer"><img class="menuIconImg" src="<%= h(imgDir) %>link.png" alt="Documentation">Online Documentation</a></li>
222+
<% } %>
214223
<%
215224
while (suppIter.hasNext()) {
216225
Map.Entry suppPair = (Map.Entry)suppIter.next();

0 commit comments

Comments
 (0)