Comparing version 0.20.1 to 0.20.5
{ | ||
"name": "tify", | ||
"version": "0.20.1", | ||
"version": "0.20.5", | ||
"description": "TIFY is a slim and mobile-friendly IIIF document viewer.", | ||
@@ -13,3 +13,3 @@ "homepage": "https://github.com/subugoe/tify", | ||
}, | ||
"author": "Tobias Schäfer / SUB Göttingen <tschaefer@sub.uni-goettingen.de>", | ||
"author": "SUB Göttingen <info@sub.uni-goettingen.de>", | ||
"license": "AGPL-3.0", | ||
@@ -16,0 +16,0 @@ "scripts": { |
@@ -45,3 +45,2 @@ import Vue from 'vue'; | ||
case 'language': | ||
case 'title': | ||
if (typeof window.tifyOptions[key] !== 'string') { | ||
@@ -51,2 +50,3 @@ throw new Error(`TIFY option "${key}" must be a string`); | ||
break; | ||
case 'title': | ||
case 'manifest': | ||
@@ -53,0 +53,0 @@ case 'stylesheet': |
@@ -57,2 +57,3 @@ module.exports = { | ||
}, | ||
currentStructure() { | ||
@@ -71,13 +72,20 @@ if (!Array.isArray(this.$root.manifest.structures)) { | ||
const { length } = this.$root.manifest.structures; | ||
let indexOfStructureWithSmallestRange; | ||
let smallestRange; | ||
for (let i = 0; i < length; i += 1) { | ||
const { canvases } = this.$root.manifest.structures[i]; | ||
const structure = this.$root.manifest.structures[i]; | ||
const { canvases } = structure; | ||
if (canvases.some(canvasId => currentCanvasIds.indexOf(canvasId) > -1)) { | ||
return this.$root.manifest.structures[i]; | ||
if (structure.firstPage && structure.lastPage) { | ||
const currentRange = structure.lastPage - structure.firstPage; | ||
if ((currentRange < smallestRange) || !smallestRange) { | ||
indexOfStructureWithSmallestRange = i; | ||
smallestRange = currentRange; | ||
if (smallestRange === 0) break; | ||
} | ||
} | ||
} | ||
} | ||
return false; | ||
}, | ||
currentStructureMetadata() { | ||
if (this.currentStructure.metadata && this.currentStructure.metadata.length) { | ||
return this.currentStructure.metadata; | ||
if (typeof indexOfStructureWithSmallestRange === 'number' && indexOfStructureWithSmallestRange >= 0) { | ||
return this.$root.manifest.structures[indexOfStructureWithSmallestRange]; | ||
} | ||
@@ -87,3 +95,12 @@ | ||
}, | ||
currentStructureLabel() { | ||
const { label } = this.currentStructure; | ||
return label; | ||
}, | ||
currentStructureMetadata() { | ||
const { metadata } = this.currentStructure; | ||
return metadata; | ||
}, | ||
}, | ||
}; |
@@ -36,1 +36,14 @@ Feature('Info'); | ||
}); | ||
Scenario('Show metadata of a nested structure', (I) => { | ||
I.amOnPage('http://localhost:8080/?manifest=http://localhost:8081/manifest/gdz-DE_611_BF_5619_1801_1806.json'); | ||
I.waitForElement('.tify-app_main'); | ||
I.click('Next page'); | ||
I.click('Next page'); | ||
I.click('Next page'); | ||
I.click('Next page'); | ||
I.click('Info'); | ||
I.see('Current Element'); | ||
I.see('[Brief des Barons von Asch an Heyne vom 29.01./10.02.1801]', '.tify-info_section.-metadata.-structure'); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
1334870
117
10196
3