Comparing version 0.26.1 to 0.27.0
{ | ||
"name": "tify", | ||
"version": "0.26.1", | ||
"version": "0.27.0", | ||
"description": "TIFY is a slim and mobile-friendly IIIF document viewer.", | ||
@@ -35,3 +35,3 @@ "homepage": "https://tify.rocks/", | ||
"devDependencies": { | ||
"@mdi/js": "^6.9.96", | ||
"@mdi/js": "^7.0.96", | ||
"@vue/cli-plugin-babel": "^4.5.19", | ||
@@ -54,10 +54,10 @@ "@vue/cli-plugin-e2e-cypress": "~4.5.19", | ||
"node-sass-glob-importer": "^5.3.2", | ||
"openseadragon": "^3.1.0", | ||
"openseadragon": "^3.0.0", | ||
"promise-polyfill": "^8.2.3", | ||
"sass": "^1.54.2", | ||
"sass": "^1.54.5", | ||
"sass-loader": "^10.3.1", | ||
"striptags": "^3.2.0", | ||
"vue": "^2.7.8", | ||
"vue": "^2.7.10", | ||
"vue-automatic-import-loader": "^1.0.0", | ||
"vue-template-compiler": "^2.7.8" | ||
"vue-template-compiler": "^2.7.10" | ||
}, | ||
@@ -64,0 +64,0 @@ "engines": { |
@@ -26,7 +26,7 @@ <h1> | ||
``` html | ||
<script src="tify.js?v0.26.1"></script> | ||
<link rel="stylesheet" href="tify.css?v0.26.1"> | ||
<script src="tify.js?v0.27.0"></script> | ||
<link rel="stylesheet" href="tify.css?v0.27.0"> | ||
``` | ||
> To avoid issues with browser caching, add a query parameter with the current version, e.g. `?v0.26.1`. | ||
> To avoid issues with browser caching, add a query parameter with the current version, e.g. `?v0.27.0`. | ||
@@ -36,4 +36,4 @@ - Or use [jsDelivr](https://www.jsdelivr.com/): | ||
``` html | ||
<script src="https://cdn.jsdelivr.net/npm/tify@0.26.1/dist/tify.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tify@0.26.1/dist/tify.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/tify@0.27.0/dist/tify.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tify@0.27.0/dist/tify.css"> | ||
``` | ||
@@ -93,5 +93,5 @@ | ||
- **`pages`**: array of 1-based integers, default `[1]` | ||
- **`pages`**: array of 1-based integers or `null` (default) | ||
The page(s) to display initially. Page numbers are physical numbers, starting at 1. This setting can be overridden by setting `pages` via URL query if `urlQueryKey` is set. | ||
The page(s) to display initially. If `null`, the initial page is determined by the manifest’s `startCanvas`, and if that is not set either, the first page is displayed. Page numbers start at 1. | ||
@@ -108,7 +108,7 @@ - **`pan`**: object, default `{}` | ||
If set, parameters are read from the URL query and any changes are reflected, using the key provided. This works with multiple concurrent instances, but each instance must use a unique key. | ||
If set, parameters are read from the URL query and any changes are reflected, using the key provided. This works with multiple concurrent instances, but each instance must use a unique key. Note that when `urlQueryKey` is set, all options defined by `urlQueryParams` can be overridden by changing the URL in the browser’s address bar. | ||
- **`urlQueryParams`**: array of strings, default `['filters', 'pages', 'pan', 'rotation', 'view', 'zoom']` | ||
The parameter keys to be stored in the URL query on change. Only has effect if `urlQueryKey` is set. | ||
The parameter keys to be read from and stored in the URL query. Only has effect if `urlQueryKey` is set, in which case parameters read from the URL override options of the same name. | ||
@@ -115,0 +115,0 @@ - **`view`**: string, default `''` |
@@ -28,3 +28,3 @@ import Vue from 'vue'; | ||
pageLabelFormat: 'P : L', | ||
pages: [1], | ||
pages: null, | ||
pan: {}, | ||
@@ -31,0 +31,0 @@ rotation: null, |
@@ -14,2 +14,16 @@ export default { | ||
methods: { | ||
getStartPages() { | ||
const { pages } = this.options; | ||
if (pages) { | ||
return pages; | ||
} | ||
const { startCanvas } = this.manifest.sequences[0]; | ||
const startPage = startCanvas | ||
? this.canvases.findIndex((canvas) => canvas['@id'] === startCanvas) + 1 | ||
: 1; | ||
return [startPage]; | ||
}, | ||
isValidPagesArray(pages) { | ||
@@ -46,2 +60,3 @@ if (!Array.isArray(pages)) { | ||
if (pages.length === 1 | ||
&& this.options.pages | ||
&& this.options.pages[0] % 2 < 1 | ||
@@ -110,8 +125,8 @@ && (this.options.pages[1] === this.options.pages[0] + 1 || this.options.pages[1] === 0) | ||
if (params.pages && !this.isValidPagesArray(params.pages)) { | ||
this.$root.error = 'Invalid pages, reset to first page'; | ||
params.pages = [1]; | ||
this.$root.error = 'Invalid pages, reset to start page'; | ||
params.pages = this.getStartPages(); | ||
} | ||
this.options.filters = params.filters || this.options.filters; | ||
this.options.pages = params.pages || this.options.pages; | ||
this.options.pages = params.pages || this.getStartPages(); | ||
this.options.pan = params.panX || params.panY | ||
@@ -118,0 +133,0 @@ ? { x: params.panX, y: params.panY } |
@@ -7,5 +7,5 @@ describe('Export', () => { | ||
cy.contains('Download Individual Images').should('be.visible'); | ||
cy.contains('Page 1').should('be.visible'); | ||
cy.contains('Page 2').should('be.visible'); // NOTE: Page set by startCanvas | ||
cy.get('[title="Next page"]').first().click(); | ||
cy.contains('Page 2').should('be.visible'); | ||
cy.contains('Page 3').should('be.visible'); | ||
@@ -12,0 +12,0 @@ cy.contains('PDFs for each element').click(); |
@@ -53,3 +53,3 @@ { | ||
"viewingHint": "paged", | ||
"startCanvas": "//localhost:8081/info/canvas/gdz:PPN857449303:00000001", | ||
"startCanvas": "//localhost:8081/info/canvas/gdz:PPN857449303:00000002", | ||
"canvases": [ | ||
@@ -56,0 +56,0 @@ { |
@@ -9,2 +9,6 @@ import Tify from '@/main'; | ||
it('should determine the start page based on startCanvas', () => { | ||
expect(app.getStartPages()).toEqual([2]); | ||
}); | ||
it('should validate page numbers', () => { | ||
@@ -11,0 +15,0 @@ expect(app.isValidPagesArray([1])).toEqual(true); |
# Upgrading TIFY | ||
## Any prior release to v0.27 | ||
- The initially displayed page is now determined by the manifest’s `startCanvas`. To keep the previous behavior of starting with the first page regardless of `startCanvas`, add `pages: [1]` to TIFY’s options. | ||
## Any prior release to v0.26 | ||
@@ -4,0 +8,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25301
1567200