Sha256: 5c8cd6f595ac9f2be5cb17f5b5bb48034db308654f881a8c6c213b867dac490a
Contents?: true
Size: 1.2 KB
Versions: 109
Compression:
Stored size: 1.2 KB
Contents
export default class Iiif { constructor(manifestUrl, manifest) { this.manifestUrl = manifestUrl; this.manifest = manifest; } sequences() { var it = {}; var context = this; it[Symbol.iterator] = function*() { for (let sequence of context.manifest.sequences) { yield sequence; }; } return it; } canvases() { var it = {}; var context = this; it[Symbol.iterator] = function*() { for (let sequence of context.sequences()) { for (let canvas of sequence.canvases) { yield canvas; } } } return it; } images() { var it = {}; var context = this; it[Symbol.iterator] = function*() { for (let canvas of context.canvases()) { for (let image of canvas.images) { var iiifService = image.resource.service['@id']; yield { 'thumb': iiifService + '/full/!100,100/0/default.jpg', 'tilesource': iiifService + '/info.json', 'manifest': context.manifestUrl, 'canvasId': canvas['@id'], 'imageId': image['@id'] }; } } } return it; } imagesArray() { return Array.from(this.images()) } }
Version data entries
109 entries across 109 versions & 1 rubygems