craigsapp/website-polish-scores

download and open pitch ranges in new window icons

Closed this issue · 3 comments

It would be useful to add these two icons:

Screenshot 2024-01-22 at 00 16 23

After the "finals" checkbox for vocal ranges:

Screenshot 2024-01-22 at 00 16 30

The download button would download the vocal range plot to the users' computer (to insert in MS Word or similar text editor for example), and the expand icon would be used to open the image in a new window for a larger display (and optionally download from there as well).

Implemented in commit f1f2e4d

Example:

Screenshot 2024-01-22 at 05 08 38

Clicking on the new download button will download to a filename that contains the file ID of the score, such as pl-kk--kk-i-376--003-prange.svg in this case.

Clicking on the expand button will open in a new window:

Screenshot 2024-01-22 at 05 10 24

This will load the image directly from the data server:

https://humdrum.nifc.pl/pl-kk--kk-i-376--003-prange-duration-final.svg

Notice that the display will match the check box options for the pitch range analysis entry, which in this case selected the duration variant with display of final notes (this is also true for download button).

Commit 0ab26c2 preserves the checkbox options similar to the new window option.

The downloaded filename will be pl-kk--kk-i-376--003-prange-duration-final.svg when the durations and finals checkboxes are selected, for example.

When a century ID is used, the colon is converted into an underscore automatically (since colons are not really allowed in MacOS). May behave differently in linux and windows (only tested on a mac).

For example: the century ID 17xx:577 will have a download filename of 17xx_577-prange-attack.svg