manifesto.js
Advanced tools
Comparing version
@@ -19,2 +19,3 @@ import { ManifestResource, PropertyValue, LabelValuePair, TreeNode, IManifestoOptions, Collection } from "./internal"; | ||
getLicense(): string | null; | ||
getRights(): string | null; | ||
getNavDate(): Date; | ||
@@ -21,0 +22,0 @@ getRelated(): any; |
@@ -77,3 +77,5 @@ "use strict"; | ||
} | ||
logo = provider.logo; | ||
// get the first agent in the provider array with a logo | ||
var agent = provider.find(function (item) { return item.logo !== undefined; }); | ||
logo = typeof agent.logo === "undefined" ? null : agent.logo; | ||
} | ||
@@ -92,2 +94,13 @@ if (!logo) | ||
}; | ||
IIIFResource.prototype.getRights = function () { | ||
var rights = this.getProperty("rights"); | ||
if (!rights) | ||
return null; | ||
if (typeof rights === "string") | ||
return rights; | ||
if (Array.isArray(rights) && rights.length) { | ||
rights = rights[0]; | ||
} | ||
return rights["@id"] || rights.id; | ||
}; | ||
IIIFResource.prototype.getNavDate = function () { | ||
@@ -94,0 +107,0 @@ return new Date(this.getProperty("navDate")); |
@@ -19,2 +19,3 @@ import { ManifestResource, PropertyValue, LabelValuePair, TreeNode, IManifestoOptions, Collection } from "./internal"; | ||
getLicense(): string | null; | ||
getRights(): string | null; | ||
getNavDate(): Date; | ||
@@ -21,0 +22,0 @@ getRelated(): any; |
@@ -75,3 +75,5 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
logo = provider.logo; | ||
// get the first agent in the provider array with a logo | ||
var agent = provider.find(function (item) { return item.logo !== undefined; }); | ||
logo = typeof agent.logo === "undefined" ? null : agent.logo; | ||
} | ||
@@ -90,2 +92,13 @@ if (!logo) | ||
}; | ||
IIIFResource.prototype.getRights = function () { | ||
var rights = this.getProperty("rights"); | ||
if (!rights) | ||
return null; | ||
if (typeof rights === "string") | ||
return rights; | ||
if (Array.isArray(rights) && rights.length) { | ||
rights = rights[0]; | ||
} | ||
return rights["@id"] || rights.id; | ||
}; | ||
IIIFResource.prototype.getNavDate = function () { | ||
@@ -92,0 +105,0 @@ return new Date(this.getProperty("navDate")); |
{ | ||
"name": "manifesto.js", | ||
"version": "4.2.17", | ||
"version": "4.2.18", | ||
"description": "IIIF Presentation API utility library for client and server", | ||
@@ -5,0 +5,0 @@ "main": "./dist-commonjs/index.js", |
@@ -9,2 +9,7 @@ # manifesto | ||
> [!NOTE] | ||
> 3D extensions to the manifesto.js library are under development in a fork [IIIF-Commons/manifesto-3d](https://github.com/IIIF-Commons/manifesto-3d). | ||
> This development is being performed in parallel with development of 3D extensions to the IIIF APIs documented in [IIIF/3d](https://github.com/IIIF/3d). | ||
## Getting Started | ||
@@ -11,0 +16,0 @@ |
@@ -58,3 +58,3 @@ const finalhandler = require('finalhandler'); | ||
// importTest('LanguageMap', './tests/LanguageMap.test'); | ||
// importTest('logo', './tests/logo'); | ||
importTest('logo', './tests/logo'); | ||
// importTest('lunchroommanners', './tests/lunchroommanners'); | ||
@@ -79,3 +79,3 @@ // importTest('manifest-with-thumbnail', './tests/manifest-with-thumbnail'); | ||
// importTest('pres3-pdf', './tests/pres3-pdf'); | ||
// importTest('pres3', './tests/pres3'); | ||
importTest('pres3', './tests/pres3'); | ||
// importTest('presentation2-paging', './tests/presentation2-paging'); | ||
@@ -82,0 +82,0 @@ // importTest('presentation3-paging', './tests/presentation3-paging'); |
@@ -49,2 +49,12 @@ var expect = require('chai').expect; | ||
}); | ||
it('has a logo', function () { | ||
var logo = manifest.getLogo(); | ||
expect(logo).to.equal('https://example.org/logos/institution1.jpg'); | ||
}); | ||
it('has a rights', function () { | ||
var rights = manifest.getRights(); | ||
expect(rights).to.equal('http://example.org/license.html'); | ||
}); | ||
}); |
@@ -60,2 +60,3 @@ /// <reference types="node" /> | ||
getLicense(): string | null; | ||
getRights(): string | null; | ||
getNavDate(): Date; | ||
@@ -62,0 +63,0 @@ getRelated(): any; |
Sorry, the diff of this file is not supported yet
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 too big to display
37960411
0.01%310770
0.01%35
16.67%