From 10f01d6b47c45d0787df69c7d6cb82a963987987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFs=20Poujade?= <lois.poujade@tetras-libre.fr> Date: Fri, 23 Sep 2022 20:20:02 +0200 Subject: [PATCH] Fixes from review --- .env.template | 4 ++++ .gitignore | 1 + Caddyfile | 1 - README.md | 2 +- docker-compose.yml | 4 ++-- src/index.js | 19 ++++++++++++++++--- webpack/index.html | 11 ----------- webpack/webpack.config.js | 10 ---------- 8 files changed, 24 insertions(+), 28 deletions(-) create mode 100644 .env.template delete mode 100644 webpack/index.html delete mode 100644 webpack/webpack.config.js diff --git a/.env.template b/.env.template new file mode 100644 index 0000000..c4b0b25 --- /dev/null +++ b/.env.template @@ -0,0 +1,4 @@ +# host port +PORT= +# container restart policy +RESTART= diff --git a/.gitignore b/.gitignore index 3af6e42..342adbe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ www/ +.env node_modules/ dist/ package-lock.json diff --git a/Caddyfile b/Caddyfile index 931dbb1..f3c6a8f 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 450b915..d78d52e 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 0599b99..19ab4ad 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 b482294..f0b501b 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 3b87560..0000000 --- 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 25c398e..0000000 --- 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/', - }, -}; -- GitLab