|
58 | 58 | .content {margin: 8px 12px 0 0; padding:0; text-align:justify;} |
59 | 59 | .toolButtons {margin-top: 12px;} |
60 | 60 | .styled-button{ |
| 61 | + display:inline-flex; |
| 62 | + align-items:center; |
61 | 63 | box-shadow:rgba(0,0,0,0.0.1) 0 1px 0 0; |
62 | 64 | background-color:#5B74A8; |
63 | 65 | border:1px solid #29447E; |
|
72 | 74 | cursor:pointer; |
73 | 75 | } |
74 | 76 | .styled-button:hover{background-color:#1e90ff; color:#f5f5dc;} |
| 77 | + a.styled-button{text-decoration:none; color:#fff;} |
| 78 | + a.styled-button:visited{color:#fff;} |
75 | 79 | .toolOwners {width: 80%; min-width: 300px;} |
76 | 80 | .ui-menu {width:240px;} |
77 | 81 | .dropMenu {position: absolute;} |
|
153 | 157 | // Get supporting files in map <url, icon url> |
154 | 158 | HashMap<String, String> suppFiles = SkylineToolsStoreController.getSupplementaryFiles(tool); |
155 | 159 | Iterator suppIter = suppFiles.entrySet().iterator(); |
| 160 | + boolean hasDocs = tool.hasDocumentation(); |
| 161 | + int docCount = suppFiles.size() + (hasDocs ? 1 : 0); |
156 | 162 |
|
157 | 163 | final String curToolOwners = StringUtils.join(SkylineToolsStoreController.getToolOwners(tool), ", "); |
158 | 164 | toolOwners.put(tool.getRowId(), curToolOwners); |
|
200 | 206 |
|
201 | 207 | <div class="toolButtons"> |
202 | 208 |
|
203 | | - <button type="button" id="download-tool-btn-<%=tool.getRowId()%>" class="styled-button">Download <span class="visually-hidden"><%=h(tool.getName())%></span></button> |
204 | | - <% addHandler("download-tool-btn-" + tool.getRowId(), "click", "window.location.href = " + q(urlFor(SkylineToolsStoreController.DownloadToolAction.class).addParameter("id", tool.getRowId()))); %> |
| 209 | + <%=link(unsafe("Download<span class=\"visually-hidden\"> " + h(tool.getName()) + "</span>")).href(urlFor(SkylineToolsStoreController.DownloadToolAction.class).addParameter("id", tool.getRowId()).toString()).clearClasses().addClass("styled-button")%> |
205 | 210 | <% |
206 | | - if (suppFiles.size() == 1) { |
| 211 | + if (docCount == 1 && hasDocs) { |
| 212 | +%> |
| 213 | + <%=link(unsafe("Documentation<span class=\"visually-hidden\"> " + h(tool.getName()) + "</span>")).href(tool.getDocsUrl()).clearClasses().addClass("styled-button").target("_blank").rel("noopener noreferrer")%> |
| 214 | +<% |
| 215 | + } else if (docCount == 1) { |
207 | 216 | Map.Entry suppPair = (Map.Entry)suppIter.next(); |
208 | 217 | %> |
209 | | - <a href="<%=h(suppPair.getKey())%>"><button type="button" class="styled-button">Documentation</button></a> |
210 | | -<% } else if (suppFiles.size() > 1) { %> |
| 218 | + <%=link(unsafe("Documentation<span class=\"visually-hidden\"> " + h(tool.getName()) + "</span>")).href(suppPair.getKey().toString()).clearClasses().addClass("styled-button")%> |
| 219 | +<% } else if (docCount > 1) { %> |
211 | 220 | <div class="menuMouseArea"> |
212 | | - <button type="button" class="styled-button">Documentation</button> |
| 221 | + <button type="button" class="styled-button">Documentation<span class="visually-hidden"><%=h(tool.getName())%></span></button> |
213 | 222 | <ul class="dropMenu"> |
| 223 | +<% if (hasDocs) { %> |
| 224 | + <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> |
| 225 | +<% } %> |
214 | 226 | <% |
215 | 227 | while (suppIter.hasNext()) { |
216 | 228 | Map.Entry suppPair = (Map.Entry)suppIter.next(); |
|
0 commit comments