-
Notifications
You must be signed in to change notification settings - Fork 0
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
Benjamin Ory
committed
Oct 3, 2023
1 parent
81a218c
commit a71251d
Showing
5 changed files
with
4,797 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## | ||
## Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu> | ||
## Creation Date: Thu Jun 8 19:45:08 PDT 2023 | ||
## Last Modified: Thu Jun 8 19:45:11 PDT 2023 | ||
## Syntax: GNU Makefile | ||
## Filename: Makefile | ||
## vim: ts=3 | ||
## | ||
## Description: Download metadata for the 1520s project from the Google Spreadsheet | ||
## for the project's metadata. You need to update the SID variable in | ||
## _includes/metadata/Makefile when the deployment of the Google Apps | ||
## Script has changed. | ||
## | ||
## Type "make" in this directory to download the JSON files for the metadata. | ||
## into the _includes/metadata directory. | ||
## | ||
|
||
SID = AKfycbwuHJlO-idyGmlaHBhNshmSCtiOau1QsXwN3K7PHyJDZ47qvPMEvv-uACFzJCBLB7iWXw | ||
|
||
download: works | ||
|
||
works: | ||
curl -L "https://script.google.com/macros/s/$(SID)/exec?sheet=works" > works.json |
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,48 @@ | ||
<script> | ||
|
||
let METADATA = {% include_relative works.json %}; | ||
|
||
////////////////////////////// | ||
// | ||
// DOMContentLoaded event -- run after webpage has finished loading. | ||
// | ||
|
||
document.addEventListener("DOMContentLoaded", function () { | ||
fillInCensusData(METADATA); | ||
}); | ||
|
||
////////////////////////////// | ||
// | ||
// fillInCensusData -- | ||
// | ||
|
||
function fillInCensusData(data) { | ||
let workCount = 0; | ||
let noteCount = 0; | ||
let massCount = 0; | ||
let motetCount = 0; | ||
let secularCount = 0; | ||
|
||
for (let i=0; i<data.length; i++) { | ||
let count = data[i]["Note Count"]; | ||
if (count) { | ||
noteCount += parseInt(count); | ||
} | ||
} | ||
|
||
for (let i=0; i<data.length; i++) { | ||
workCount++; | ||
} | ||
|
||
let noteElement = document.querySelector("#note-count"); | ||
if (noteElement) { | ||
noteElement.innerHTML = noteCount; | ||
} | ||
|
||
let workElement = document.querySelector("#work-count"); | ||
if (workElement) { | ||
workElement.innerHTML = workCount; | ||
} | ||
} | ||
|
||
</script> |
Oops, something went wrong.