This repository has been archived by the owner on Apr 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #550 from Magenic/Accessibility_FileManagement
Accessibility: Create JS and CSS files instead of strings
- Loading branch information
Showing
4 changed files
with
218 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
165 changes: 165 additions & 0 deletions
165
jmaqs-accessibility/src/main/resources/htmlReporter.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
.thumbnail { | ||
content: url(''); | ||
border: 1px solid black; | ||
margin-left: 1em; | ||
margin-right: 1em; | ||
width: auto; | ||
max-height: 150px; | ||
} | ||
|
||
.thumbnail:hover { | ||
border: 2px solid black; | ||
} | ||
|
||
.wrap .wrapTwo .wrapThree { | ||
margin: 2px; | ||
max-width: 70vw; | ||
} | ||
|
||
.wrapOne { | ||
margin-left: 1em; | ||
} | ||
|
||
.wrapTwo { | ||
margin-left: 2em; | ||
} | ||
|
||
.wrapThree { | ||
margin-left: 3em; | ||
} | ||
|
||
.emOne { | ||
margin-left: 1em; | ||
margin-right: 1em; | ||
} | ||
|
||
.emTwo { | ||
margin-left: 2em; | ||
} | ||
|
||
.emThree { | ||
margin-left: 3em; | ||
} | ||
|
||
#modal { | ||
display: none; | ||
position: fixed; | ||
z-index: 1; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
overflow: auto; | ||
background-color: rgba(0, 0, 0, 0.9); | ||
flex-direction: column; | ||
} | ||
|
||
#modalclose { | ||
font-family: Lucida Console; | ||
font-size: 35px; | ||
width: auto; | ||
color: white; | ||
text-align: right; | ||
padding: 20px; | ||
cursor: pointer; | ||
max-height: 10%; | ||
} | ||
|
||
#modalimage { | ||
margin: auto; | ||
display: block; | ||
max-width: 95%; | ||
padding: 10px; | ||
max-height: 90%; | ||
} | ||
|
||
.htmlTable { | ||
border-top: double lightgray; | ||
width: 100%; | ||
display: table; | ||
} | ||
|
||
.sectionbutton { | ||
background-color: #000000; | ||
color: #ffffff; | ||
cursor: pointer; | ||
padding: 18px; | ||
width: 100%; | ||
text-align: left; | ||
outline: none; | ||
transition: 0.4s; | ||
border: 1px solid black; | ||
} | ||
|
||
.sectionbutton:hover { | ||
background-color: #828282; | ||
} | ||
|
||
.buttonInfoText { | ||
width: 50%; | ||
float: left; | ||
} | ||
|
||
.buttonExpandoText { | ||
text-align: right; | ||
width: 50%; | ||
float: right; | ||
} | ||
|
||
.majorSection { | ||
padding: 0 18px; | ||
background-color: white; | ||
overflow: hidden; | ||
transition: max-height 0.2s ease-out; | ||
} | ||
|
||
.findings { | ||
margin-top: 5px; | ||
border-top: 1px solid black; | ||
} | ||
|
||
.active { | ||
background-color: #474747; | ||
margin-bottom: 0px; | ||
} | ||
|
||
.resultWrapper { | ||
margin: 5px; | ||
} | ||
|
||
#context { | ||
width: 50%; | ||
} | ||
|
||
#image { | ||
width: 50%; | ||
height: 220px; | ||
} | ||
|
||
#counts { | ||
width: 100%; | ||
} | ||
|
||
#metadata { | ||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
|
||
#results { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
@media only screen and (max-width: 800px) { | ||
#metadata { | ||
flex-direction: column; | ||
} | ||
|
||
#context { | ||
width: 100%; | ||
} | ||
|
||
#image { | ||
width: 100%; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
jmaqs-accessibility/src/main/resources/htmlReporterElements.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
var buttons = document.getElementsByClassName("sectionbutton"); | ||
var i; | ||
|
||
for (i = 0; i < buttons.length; i++) { | ||
buttons[i].addEventListener("click", function () { | ||
var expandoText = this.getElementsByClassName("buttonExpandoText")[0]; | ||
|
||
this.classList.toggle("active"); | ||
|
||
var content = this.nextElementSibling; | ||
if (expandoText.innerHTML === "-") { | ||
content.style.maxHeight = 0; | ||
expandoText.innerHTML = "+"; | ||
} else { | ||
content.style.maxHeight = content.scrollHeight + "px"; | ||
expandoText.innerHTML = "-"; | ||
} | ||
}); | ||
} | ||
|
||
var thumbnail = document.getElementById("screenshotThumbnail"); | ||
var thumbnailStyle = getComputedStyle(thumbnail); | ||
var modal = document.getElementById("modal"); | ||
var modalimg = modal.getElementsByTagName("img")[0]; | ||
|
||
modal.addEventListener("click", function () { | ||
modal.style.display = "none"; | ||
modalimg.style.content = ""; | ||
modalimg.alt = ""; | ||
}); | ||
|
||
thumbnail.addEventListener("click", function () { | ||
modal.style.display = "flex"; | ||
modalimg.style.content = thumbnailStyle.content; | ||
modalimg.alt = thumbnail.alt; | ||
}); |