Skip to content

Commit

Permalink
Implement recently added table.
Browse files Browse the repository at this point in the history
  • Loading branch information
craigsapp committed Oct 30, 2023
1 parent 4228a38 commit a44369d
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 135 deletions.
7 changes: 2 additions & 5 deletions _includes/homepage/aside/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
<a style="text-decoration:none;" onclick="ClearBrowseFields(); localStorage.BROWSEhome='false';" href="/browse"><h2 style="width:316px;" class="blue-bar">quick browse</h2></a>
<div class="form-body">
<div id="composers-select" class="form-group">
<div class="select2-container" id="s2id_composers">
<a href="javascript:void(0)" class="select2-choice" tabindex="-1"> <span class="select2-chosen" id="select2-chosen-2">All Composers</span><abbr class="select2-search-choice-close"></abbr> <span class="select2-arrow" role="presentation"><b role="presentation"></b></span></a><label for="s2id_autogen2" class="select2-offscreen"></label><input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-2" id="s2id_autogen2">
<div class="select2-drop select2-display-none select2-with-searchbox"> <div class="select2-search"> <label for="s2id_autogen2_search" class="select2-offscreen"></label> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-2" id="s2id_autogen2_search" placeholder=""> </div> <ul class="select2-results" role="listbox" id="select2-results-2"> </ul></div>
</div>
<div class="select2-container" id="s2id_composers"> <a href="javascript:void(0)" class="select2-choice" tabindex="-1"> <span class="select2-chosen" id="select2-chosen-2">All Composers</span><abbr class="select2-search-choice-close"></abbr> <span class="select2-arrow" role="presentation"><b role="presentation"></b></span></a><label for="s2id_autogen2" class="select2-offscreen"></label><input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-2" id="s2id_autogen2"> <div class="select2-drop select2-display-none select2-with-searchbox"> <div class="select2-search"> <label for="s2id_autogen2_search" class="select2-offscreen"></label> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-2" id="s2id_autogen2_search" placeholder=""> </div> <ul class="select2-results" role="listbox" id="select2-results-2"> </ul></div> </div>
</div>
<div id="genres-select" class="form-group">
<div style="height:26px;"></div>
<div class="select2-container" id="s2id_genres"><a href="javascript:void(0)" class="select2-choice" tabindex="-1"> <span class="select2-chosen" id="select2-chosen-3">All Genres</span><abbr class="select2-search-choice-close"></abbr> <span class="select2-arrow" role="presentation"><b role="presentation"></b></span></a><label for="s2id_autogen3" class="select2-offscreen"></label><input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-3" id="s2id_autogen3"><div class="select2-drop select2-display-none select2-with-searchbox"> <div class="select2-search"> <label for="s2id_autogen3_search" class="select2-offscreen"></label> <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" aria-owns="select2-results-3" id="s2id_autogen3_search" placeholder=""> </div> <ul class="select2-results" role="listbox" id="select2-results-3"> </ul></div></div>
</div>
<div class="form-group">
<input id="titlebox" name="t" value="" type="text" class="form-control" placeholder="Enter Title">
Expand Down
5 changes: 0 additions & 5 deletions _includes/scripts/scripts-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ var WORKLIST; // Master index of works in JRP database.
var WORKLISTrecent = []; // List of works reverse sorted by add date.
var WORKLISTjrpid = {}; // Hash of works by JRP ID.
var BASEADDR = window.location.host; // Base address of URL.
console.log("BASEADDR = ", BASEADDR, "*******************************************************");
var TARGET = "_blank"; // target for new things
var PDFTARGET = TARGET; // Display PDF files in separate tab/window.
var AUDIO = null; // HTML5 audio interface ID.
Expand Down Expand Up @@ -387,7 +386,6 @@ function GetComposerOptions(worklist) {

for (let i=0; i<worklist.length; i++) {
let entry = worklist[i];
console.warn("ENTRY", entry);
let cid = entry.COMPOSER_ID.trim();
let matches = cid.match(";");
if (matches) {
Expand Down Expand Up @@ -416,9 +414,6 @@ console.warn("ENTRY", entry);
}
}

console.warn("COUNTS", counts);
console.warn("LONGNAMES", longNames);

let keys = Object.keys(counts);
keys.sort();

Expand Down
18 changes: 9 additions & 9 deletions _includes/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ Version: 3.4.6 Timestamp: Sat Mar 22 22:30:15 EDT 2014
font-size: 1px;
text-decoration: none;
border: 0;
background: url("select2.png") right top no-repeat;
background: url("/images/select2.png") right top no-repeat;
cursor: pointer;
outline: 0;
}
Expand Down Expand Up @@ -730,11 +730,11 @@ Version: 3.4.6 Timestamp: Sat Mar 22 22:30:15 EDT 2014
border-radius: 0;
-webkit-box-shadow: none;
box-shadow: none;
background: white url("select2.png") no-repeat 100% -22px;
background: url("select2.png") no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url("select2.png") no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url("select2.png") no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url("select2.png") no-repeat 100% -22px, linear-gradient(to bottom, #ffffff 85%, #eeeeee 99%) 0 0;
background: white url("/images/select2.png") no-repeat 100% -22px;
background: url("/images/select2.png") no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url("/images/select2.png") no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url("/images/select2.png") no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url("/images/select2.png") no-repeat 100% -22px, linear-gradient(to bottom, #ffffff 85%, #eeeeee 99%) 0 0;
}

.select2-drop.select2-drop-above .select2-search input {
Expand Down Expand Up @@ -1023,7 +1023,7 @@ html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
top: 4px;
font-size: 1px;
outline: none;
background: url("select2.png") right top no-repeat;
background: url("/images/select2.png") right top no-repeat;
}

html[dir="rtl"] .select2-search-choice-close {
Expand Down Expand Up @@ -1103,13 +1103,13 @@ html[dir="rtl"] .select2-search-choice-close {
/* Retina-ize icons */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx) {
.select2-search input, .select2-search-choice-close {
background-image: url("select2.png") !important;
background-image: url("/images/select2.png") !important;
background-repeat: no-repeat !important;
background-size: 60px 40px !important;
}

.select2-container .select2-choice abbr, .select2-container .select2-choice .select2-arrow b {
background-image: url("select2.png") !important;
background-image: url("/images/select2.png") !important;
background-repeat: no-repeat !important;
background-size: 60px 40px !important;
}
Expand Down
Binary file added images/file-ed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/select2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/square-pause2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/square-play2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions scripts-listeners.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

<script>
//
// Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu>
// Creation Date: Thu Aug 21 12:59:01 PDT 2014
// Last Modified: Sun Oct 29 22:08:45 PDT 2023
// Filename: scripts-local.html
// Web Address: http://josquin.stanford.edu/scripts-listners.html
// Syntax: JavaScript 1.8/ECMAScript 5
// vim: ts=3:ft=javascript
//
// Description: Listeners for homepage.
//

let JRP = {};


//////////////////////////////
//
// Function called when document has finished loading:
//

document.addEventListener("DOMContentLoaded", function() {

AUDIO = document.getElementById("audio");
AUDIO.addEventListener('ended', function(e) {
AUDIO.pause();
var pauseelem = document.getElementById(AUDIOid);
pauseelem.className = "play";
}, false);

sessionStorage.removeItem('RECENTLYADDEDHTML');

let macroid = "AKfycbyeHfmyCHHgbY9X_UDMzW9xyRgqH0c7Ycp76NTW18mjZSnW_2umhgH2ZGDtxuwDot6mKw";
let url = `https://script.google.com/macros/s/${macroid}/exec`;
url += "?sheet=works";
url += "&format=json";
fetch(url)
.then(response => {
if (response.ok) {
return response.json();
} else {
throw new Error("Request failed with status " + response.status);
}
})
.then(data => {
JRP.WORKS = data;
buildComposerSelect(JRP.WORKS);
buildGenreSelect(JRP.WORKS);
displayRandomExample(JRP.WORKS);
displayRecentAdditions(7, JRP.WORKS);
})
.catch(error => {
console.error("Fetch error: " + error.message);
});

}, false);


</script>



Loading

0 comments on commit a44369d

Please sign in to comment.