craigsapp / website-polish-scores

Front-end for digital transcriptions of the Polish Music Heritage in Open Access project
https://polishscores.org
3 stars 1 forks source link

Allow switching of the ID type in the URL. #268

Closed craigsapp closed 4 months ago

craigsapp commented 4 months ago

Sometimes it is useful to set the ID by cenid, and other times by the shelfmark ID. Allow switching between these displayed in the URL.

Use alt-c to display century ID.

and

alt-s to display shelfmark ID.

craigsapp commented 4 months ago

Implemented with commit https://github.com/craigsapp/website-polish-scores/commit/b28a70c2a6e3993754734eb3e9cea65935cb78c8

Example: by default whichever ID is used in the id parameter of the URL, this style will be displayed in the URL of the work page:

https://polishscores.org/?id=pl-sa--481-a-viii-121--022

Screenshot 2024-02-10 at 19 19 16

Pressing alt-c will convert the fileid in the id URL parameter to a cenid:

https://polishscores.org/?id=18xx:393

Screenshot 2024-02-10 at 19 20 01

And pressing alt-f will conver the cenid in the id URL parameter into a fileid:

Screenshot 2024-02-10 at 19 21 01

Once you press alt-c or alt-f on a work page, that style will remain until changed in the current session with alt-c or alt-f. Before pressing one of those two keys, which ever the initial ID style of the id is used will be displayed in the URL. When entering the website from the browse page, the cenid is used by default (this could be changed).

craigsapp commented 4 months ago

Works when configuration options are present in the URL:

https://polishscores.org/?id=18xx:393&config=AsSs

Screenshot 2024-02-10 at 19 27 14