Luna LMS

Check-in [09d41bb4cf]
Login

Check-in [09d41bb4cf]

Overview
Comment:Making hidden items in course list readable for screen readers.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | development
Files: files | file ages | folders
SHA3-256: 09d41bb4cfc325074d75cfb0860da321add8170e3be4497ff109b78b37609f1a
User & Date: florian 2024-07-17 18:27:11
Context
2024-07-18
11:58
Changed border radius units from px to rem. check-in: 5ff035bf51 user: florian tags: development
2024-07-17
18:27
Making hidden items in course list readable for screen readers. check-in: 09d41bb4cf user: florian tags: development
15:58
Merged changes from search. check-in: 571d4f9b04 user: florian tags: development
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to luna_lms/webapp.py.

835
836
837
838
839
840
841







842
843
844
845
846
847
848
	vertical-align: top ;
	padding-left: 1.9rem ;
}

.course_listing p {
	margin: 0.31rem 0px 0px 0px ;
}








.redaktionssystem h2,
.redaktionssystem h3 {
	border-radius: 10px 10px 0px 0px ;
	margin-top: 1.9rem ;
	margin-bottom: 0px ;
}







>
>
>
>
>
>
>







835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
	vertical-align: top ;
	padding-left: 1.9rem ;
}

.course_listing p {
	margin: 0.31rem 0px 0px 0px ;
}

/* via https://stackoverflow.com/a/54298542/1132250 */
.screenreader_only {
	overflow: hidden ;
	height: 0 ;
	width: 0 ;
}

.redaktionssystem h2,
.redaktionssystem h3 {
	border-radius: 10px 10px 0px 0px ;
	margin-top: 1.9rem ;
	margin-bottom: 0px ;
}
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
		return_str += '''<script>
/* Partly generated by codeium.com */
window.addEventListener('DOMContentLoaded', function() {

	var paginationDivs = document.getElementsByClassName("course_pagination");
	var visibleIndex = 0;

	// Hide all
	// TODO: hide only visibly, keep for screen readers   
	for (var i = 0; i < paginationDivs.length; i++) {
		paginationDivs[i].style.display = "none";
	}

	var paginationMore = document.getElementById('course_pagination_more');

	function displayVisible() {

		paginationDivs[visibleIndex].style.display = "block";

		if (visibleIndex == paginationDivs.length - 1){
			paginationMore.style.display = "none";
		} else {
			paginationMore.style.display = "inline-block";
		}
	}







|
<

|






|







2086
2087
2088
2089
2090
2091
2092
2093

2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
		return_str += '''<script>
/* Partly generated by codeium.com */
window.addEventListener('DOMContentLoaded', function() {

	var paginationDivs = document.getElementsByClassName("course_pagination");
	var visibleIndex = 0;

	// Hide all visibily, keep for screen readers

	for (var i = 0; i < paginationDivs.length; i++) {
		paginationDivs[i].classList.add('screenreader_only');
	}

	var paginationMore = document.getElementById('course_pagination_more');

	function displayVisible() {

		paginationDivs[visibleIndex].classList.remove('screenreader_only');

		if (visibleIndex == paginationDivs.length - 1){
			paginationMore.style.display = "none";
		} else {
			paginationMore.style.display = "inline-block";
		}
	}