diff --git a/.env.template b/.env.template new file mode 100644 index 0000000000000000000000000000000000000000..c4b0b2598328c2b78bf1688083a5345386608f15 --- /dev/null +++ b/.env.template @@ -0,0 +1,4 @@ +# host port +PORT= +# container restart policy +RESTART= diff --git a/.gitignore b/.gitignore index 3af6e42942b970ac8bab60c7763ce3923edbc6f2..342adbe992850ff70bffaaafbdd198138aa5e144 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ www/ +.env node_modules/ dist/ package-lock.json diff --git a/Caddyfile b/Caddyfile index 931dbb1bec61370ac1754347a50595f3e3f4e521..f3c6a8f2e20d422abbfd9903b36539e1c4b350a5 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,5 +1,4 @@ :80 { root * /srv file_server browse - header Access-Control-Allow-Origin "*" } diff --git a/README.md b/README.md index 450b915c82b298b04dcf8b6736a38f46cd88286f..d78d52eddba2ef91042c98e7eae0578930c32341 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ ## Mirador Video Annotation POC -Run `docker-compose up -d`, which will serve a mirador instance to `http://localhost:8080`. The `www` directory is accessible via `http://localhost:8080/data` +Run `docker-compose up -d`, which will serve a mirador instance to `http://localhost:8080`. If sources files are modified, run `docker-compose up -d --build` diff --git a/docker-compose.yml b/docker-compose.yml index 0599b99d9557e8fee5aa1b04bbb545c24409bbd0..19ab4ade8027ebd6450db645ad80e2c21186eb8a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,9 +2,9 @@ version: "3.9" services: httpd: build: . - restart: unless-stopped + restart: $RESTART ports: - - "8080:80" + - $PORT:80 volumes: - ./www:/srv/data - ./Caddyfile:/etc/caddy/Caddyfile diff --git a/src/index.js b/src/index.js index b48229426bb8e2bf89602a5b31a8bbe242708556..f0b501b55d4ef7ada83a58d2d5f18b7559bf9ef4 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,20 @@ -import Mirador from 'mirador/dist/es/src/index' +import Mirador from 'mirador/dist/es/src/index'; + const config = { - id: 'demo' + id: 'demo', + theme: { transitions: window.location.port === '4488' ? { create: () => 'none' } : {}, }, + catalog: [ + { manifestId: 'http://localhost/dzkimgs_annotated_video.json' }, + { manifestId: 'http://localhost/video_split_annopage.json' }, + { manifestId: 'http://localhost/fediverse.json' }, + { manifestId: 'http://localhost/localvideo.json' }, + { manifestId: 'http://localhost/local_catvideo.json' }, + { manifestId: 'https://dzkimgs.l.u-tokyo.ac.jp/videos/iiif_in_japan_2017/manifest.json' }, + { manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json' }, + { manifestId: 'https://iiif.harvardartmuseums.org/manifests/object/299843' } + ] } -Mirador.viewer(config, []) +Mirador.viewer(config, [ +]); diff --git a/webpack/index.html b/webpack/index.html deleted file mode 100644 index 3b8756031929f696c9b02c089afae1e096b8b58e..0000000000000000000000000000000000000000 --- a/webpack/index.html +++ /dev/null @@ -1,11 +0,0 @@ -<!doctype html> -<html> - <head> - <meta charset="utf-8" /> - <title>Basic Mirador</title> - </head> - <body> - <div id="demo"></div> - <script src="dist/main.js"></script> - </body> -</html> diff --git a/webpack/webpack.config.js b/webpack/webpack.config.js deleted file mode 100644 index 25c398e9a023487e303e94a8654858f97ae74671..0000000000000000000000000000000000000000 --- a/webpack/webpack.config.js +++ /dev/null @@ -1,10 +0,0 @@ -const path = require('path'); - -module.exports = { - entry: './src/index.js', - output: { - filename: 'main.js', - path: path.resolve(__dirname, 'dist'), - publicPath: './dist/', - }, -};