wisski-mirador-integration/index.js
Robert Nasarek 44146b7801 first commit
2022-01-11 07:50:49 +01:00

22 lines
No EOL
1 KiB
JavaScript

import Mirador from 'mirador/dist/es/src/index';
import { miradorImageToolsPlugin } from 'mirador-image-tools';
import miradorAnnotationPlugins from 'mirador-annotations';
import LocalStorageAdapter from 'mirador-annotations/lib/LocalStorageAdapter'
import AnnototAdapter from 'mirador-annotations/lib/AnnototAdapter';
window.Mirador = Mirador;
// The used plugins is specified in the main js.
window.miradorPlugins = [
{name: "annotations", plugin: miradorAnnotationPlugins},
{name: "image-tools", plugin: miradorImageToolsPlugin}
,];
// The endpoint of the external annotation server is set in the main js.
const annotationEndpoint = 'http://localhost/wisski/mirador-annotations';
// Bridge to store annotations.
window.miradorAnnotationServerAdapter = typeof annotationEndpoint !== 'undefined' && annotationEndpoint
? function (canvasId, annotationEndpoint) {
return new AnnototAdapter(canvasId, annotationEndpoint) }
: function (canvasId) { return new LocalStorageAdapter(`localStorage://?canvasId=${canvasId}`); };