-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Athanasios Angeloudis
authored and
Athanasios Angeloudis
committed
Aug 27, 2024
1 parent
584f04d
commit 51cddaa
Showing
101 changed files
with
2,260 additions
and
220 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
sphinx-quickstart on Fri May 18 18:18:29 2018. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
.. only:: html | ||
.. _email: mailto: [email protected] | ||
|
||
|
@@ -12,11 +12,7 @@ Teaching | |
This section summarises teaching responsibilities within the Discipline of Civil & Environmental Engineering. | ||
|
||
|
||
.. container:: toggle | ||
|
||
.. container:: header | ||
|
||
*Hydraulic Engineering IV* | ||
.. dropdown:: *Hydraulic Engineering IV* | ||
|
||
.. container :: note2 | ||
|
@@ -25,11 +21,7 @@ This section summarises teaching responsibilities within the Discipline of Civil | |
*Hydraulic Engineering IV* is a 4th year undergraduate civil engineering module on unsteady flows. I deliver material on open channel flows and hydraulic transients in pipe systems. Specifically, the content covers specifically flood routing, St Venant Equations, Solitary Waves, Surges and Coastal Waves and the Water Hammer phenomenon. `Course Website <http://www.drps.ed.ac.uk/18-19/dpt/cxcive10006.htm>`_ | ||
|
||
|
||
.. container:: toggle | ||
|
||
.. container:: header | ||
|
||
*Water Engineering, Transport & Treatment III* | ||
.. dropdown:: *Water Engineering, Transport & Treatment III* | ||
|
||
.. container :: note2 | ||
|
@@ -43,11 +35,7 @@ Educational Resources | |
|
||
General information on the broader themes that relate to our research activities. | ||
|
||
.. container:: toggle2 | ||
|
||
.. container:: header | ||
|
||
*Tidal Energy Open Educational Resource* | ||
.. dropdown:: *Tidal Energy Open Educational Resource* | ||
|
||
.. container :: note2 | ||
|
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
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,101 @@ | ||
// @ts-check | ||
|
||
// Extra JS capability for selected tabs to be synced | ||
// The selection is stored in local storage so that it persists across page loads. | ||
|
||
/** | ||
* @type {Record<string, HTMLElement[]>} | ||
*/ | ||
let sd_id_to_elements = {}; | ||
const storageKeyPrefix = "sphinx-design-tab-id-"; | ||
|
||
/** | ||
* Create a key for a tab element. | ||
* @param {HTMLElement} el - The tab element. | ||
* @returns {[string, string, string] | null} - The key. | ||
* | ||
*/ | ||
function create_key(el) { | ||
let syncId = el.getAttribute("data-sync-id"); | ||
let syncGroup = el.getAttribute("data-sync-group"); | ||
if (!syncId || !syncGroup) return null; | ||
return [syncGroup, syncId, syncGroup + "--" + syncId]; | ||
} | ||
|
||
/** | ||
* Initialize the tab selection. | ||
* | ||
*/ | ||
function ready() { | ||
// Find all tabs with sync data | ||
|
||
/** @type {string[]} */ | ||
let groups = []; | ||
|
||
document.querySelectorAll(".sd-tab-label").forEach((label) => { | ||
if (label instanceof HTMLElement) { | ||
let data = create_key(label); | ||
if (data) { | ||
let [group, id, key] = data; | ||
|
||
// add click event listener | ||
// @ts-ignore | ||
label.onclick = onSDLabelClick; | ||
|
||
// store map of key to elements | ||
if (!sd_id_to_elements[key]) { | ||
sd_id_to_elements[key] = []; | ||
} | ||
sd_id_to_elements[key].push(label); | ||
|
||
if (groups.indexOf(group) === -1) { | ||
groups.push(group); | ||
// Check if a specific tab has been selected via URL parameter | ||
const tabParam = new URLSearchParams(window.location.search).get( | ||
group | ||
); | ||
if (tabParam) { | ||
console.log( | ||
"sphinx-design: Selecting tab id for group '" + | ||
group + | ||
"' from URL parameter: " + | ||
tabParam | ||
); | ||
window.sessionStorage.setItem(storageKeyPrefix + group, tabParam); | ||
} | ||
} | ||
|
||
// Check is a specific tab has been selected previously | ||
let previousId = window.sessionStorage.getItem( | ||
storageKeyPrefix + group | ||
); | ||
if (previousId === id) { | ||
// console.log( | ||
// "sphinx-design: Selecting tab from session storage: " + id | ||
// ); | ||
// @ts-ignore | ||
label.previousElementSibling.checked = true; | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Activate other tabs with the same sync id. | ||
* | ||
* @this {HTMLElement} - The element that was clicked. | ||
*/ | ||
function onSDLabelClick() { | ||
let data = create_key(this); | ||
if (!data) return; | ||
let [group, id, key] = data; | ||
for (const label of sd_id_to_elements[key]) { | ||
if (label === this) continue; | ||
// @ts-ignore | ||
label.previousElementSibling.checked = true; | ||
} | ||
window.sessionStorage.setItem(storageKeyPrefix + group, id); | ||
} | ||
|
||
document.addEventListener("DOMContentLoaded", ready, false); |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.