Skip to content

Commit

Permalink
Continued implementation for issue #249
Browse files Browse the repository at this point in the history
  • Loading branch information
craigsapp committed Feb 11, 2024
1 parent d6071e7 commit 86e7917
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 3 deletions.
4 changes: 3 additions & 1 deletion _includes/browse/filterBySearchFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ POPC2.prototype.filterBySearchFlags = function (input) {

// Flags expected to be in alphabetical order:
// BASSOCONTINUO
// FINGERING
// IIIF
// MODERN
// SINGLE
// TEXT
let pattern = "";
let count = 0;
let count2 = 0;
if (fields.BASSOCONTINUO) { pattern += ".*F"; count++; }
if (fields.BASSOCONTINUO) { pattern += ".*B"; count++; }
if (fields.FINGERING) { pattern += ".*F"; count++; }
if (fields.IIIF) { pattern += ".*I"; count++; }
if (fields.MODERN) { pattern += ".*M"; count++; }
if (fields.SINGLE) { pattern += ".*S"; count++; }
Expand Down
1 change: 1 addition & 0 deletions _includes/browse/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
{% include browse/toggleComposerSort.js %}
{% include browse/toggleDateSorting.js %}
{% include browse/toggleBassoContinuoScores.js %}
{% include browse/toggleFingeringScores.js %}
{% include browse/toggleIiifScores.js %}
{% include browse/toggleModernScores.js %}
{% include browse/toggleShelfmarkSort.js %}
Expand Down
36 changes: 36 additions & 0 deletions _includes/browse/toggleFingeringScores.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% comment %}
//
// Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu>
// Creation Date: Thu Aug 10 15:04:37 CEST 2023
// Last Modified: Thu Aug 10 15:48:06 CEST 2023
// Filename: _includes/browse/toggleFingeringScores.js
// Used by:
// Included in: _includes/browse/main.html
// Syntax: ECMAScript 6
// vim: ts=3:nowrap
//
// Description: Toggle displaying only modernized scores
//
{% endcomment %}

POPC2.prototype.toggleFingeringScores = function () {
this.DebugMessageFunction();

if (popc2.IsBrowsePage()) {
popc2.VARS.SEARCH_FLAGS.FINGERING = !popc2.VARS.SEARCH_FLAGS.FINGERING;
let element = document.querySelector("#fintering-browse-button");
if (element) {
if (popc2.VARS.SEARCH_FLAGS.FINGERING) {
element.classList.add("highlight");
} else {
element.classList.remove("highlight");
}
}
popc2.doBrowseSearch();
}
};

Object.defineProperty(POPC2.prototype.toggleFingeringScores, "name", { value: "toggleFingeringScores" });



1 change: 1 addition & 0 deletions _includes/initialize/POPC2.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ function POPC2() {
this.VARS.SEARCH_FLAGS.MODERN = false; // Search only files with modernized scores.
this.VARS.SEARCH_FLAGS.IIIF = false; // Search only files with IIIF bounding boxes.
this.VARS.SEARCH_FLAGS.BASSOCONTINUO = false; // Search only files with basso continuo figures.
this.VARS.SEARCH_FLAGS.FINGERING = false; // Search only files with fingerings.
this.VARS.SEARCH_FLAGS.TEXT = 0; // Search only files containg lyrical text.
// 0 = search both texted and textless works.
// 1 = search texted works.
Expand Down
9 changes: 7 additions & 2 deletions _includes/navigator/toolbar-browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,19 @@
data-transatt="title:accessibility" onclick="popc2.displayInfoPage('access');">
</div>

<div id="date-browse-button" class="tab trans worknav-tool fas fa-d"
role="button" tabindex="0"
data-transatt="title:date_sort" onclick="popc2.toggleDateSorting();">
</div>

<div id="basso-continuo-browse-button" class="tab trans worknav-tool fas fa-b"
role="button" tabindex="0"
data-transatt="title:basso_continuo_scores" onclick="popc2.toggleBassoContinuoScores();">
</div>

<div id="date-browse-button" class="tab trans worknav-tool fas fa-d"
<div id="date-browse-button" class="tab trans worknav-tool fas fa-f"
role="button" tabindex="0"
data-transatt="title:date_sort" onclick="popc2.toggleDateSorting();">
data-transatt="title:fingering_scores" onclick="popc2.toggleFingeringScores();">
</div>

<div id="iiif-browse-button" class="tab trans worknav-tool fas fa-i"
Expand Down
6 changes: 6 additions & 0 deletions _includes/translations/basic.aton
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
@PL: Toggle list of scores with basso continuo figures
@@END: ENTRY

@@BEGIN: ENTRY
@TAG: fingering_scores
@EN: Toggle list of scores with fingerings
@PL: Toggle list of scores with fingerings
@@END: ENTRY

@@BEGIN: ENTRY
@TAG: date_sort
@EN: Toggle ordering of scores by upload/revision date
Expand Down

0 comments on commit 86e7917

Please sign in to comment.