Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ new Tify({
container: '#tify',
language: 'de',
manifestUrl: 'https://example.org/iiif-manifest.json',
pageLabelFormat: 'P (L)',
pageLabelFormat: 'P (L) / T',
pages: [2, 3],
pan: { x: .45, y: .6 },
translationsDirUrl: '/translations/tify',
Expand Down
1 change: 1 addition & 0 deletions src/components/PageName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default {
html() {
return `<span>${this.$store.options.pageLabelFormat}</span>`
.replace('P', `${this.number}`)
.replace('T', `${this.$store.pageCount}`)
.replace('L', `</span>${this.label}<span>`)
.replace('<span></span>', '');
},
Expand Down
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export default {
* thumbnails view. The placeholder `P` is replaced by the page number
* (consecutive numbers starting at `1`) while `L` is replaced by the
* page label, which can be any string, defined by the manifest.
* The placeholder `T` is replaced by the total number of pages.
* If the page label is missing, only the page number is displayed,
* regardless of the format.
*
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@ function Store(args = {}) {
const label = store.localize(labelObject, '');

if (label) {
return store.options.pageLabelFormat.replace('P', number).replace('L', label);
return store.options.pageLabelFormat
.replace('P', number)
.replace('T', store.pageCount)
.replace('L', label);
}

return store.options.pageLabelFormat.includes('P')
Expand Down
Loading