Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimon committed Sep 30, 2024
1 parent 4f737bf commit ead4840
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 69 deletions.
139 changes: 71 additions & 68 deletions packages/extension-tei/test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,87 +6,90 @@
<link rel="stylesheet" href="CETEIcean.css">
<script type="module" src="../src/index.ts"></script>
<style>
*, *:before, *:after {
box-sizing: border-box;
}

html, body {
background: #e2e2e2;
padding: 0;
margin: 0;
display: flex;
flex-direction: row;
justify-content: center;
}

#content {
max-width: 800px;
background-color: #fff;
padding: 40px;
border-style: solid;
border-color: #cfcfcf;
border-width: 0 1px;
position: relative;
}

#content img {
max-width: 100%;
}

h1 {
margin: 0;
padding: 0 0 20px 0;
}

p {
font-size: 17px;
line-height: 160%;
}
*,
*:before,
*:after {
box-sizing: border-box;
}

html,
body {
background: #e2e2e2;
padding: 0;
margin: 0;
display: flex;
flex-direction: row;
justify-content: center;
}

#content {
max-width: 800px;
background-color: #fff;
padding: 40px;
border-style: solid;
border-color: #cfcfcf;
border-width: 0 1px;
position: relative;
}

#content img {
max-width: 100%;
}

h1 {
margin: 0;
padding: 0 0 20px 0;
}

p {
font-size: 17px;
line-height: 160%;
}
</style>
</head>

<body>
<div id="content">
</div>
<div id="content">
</div>

<script type="module">
import CETEI from 'CETEIcean';
import { createTextAnnotator } from '@recogito/text-annotator';
import { TEIPlugin } from '../src/index.ts';
<script type="module">
import CETEI from 'CETEIcean';
import { createTextAnnotator } from '@recogito/text-annotator';
import { TEIPlugin } from '../src/index.ts';

import '@recogito/text-annotator/dist/text-annotator.css';
import '@recogito/text-annotator/dist/text-annotator.css';

window.onload = async function () {
var CETEIcean = new CETEI();
window.onload = async function () {
var CETEIcean = new CETEI();

CETEIcean.getHTML5('macbeth.xml', data => {
document.getElementById('content').appendChild(data);
CETEIcean.getHTML5('macbeth.xml', data => {
document.getElementById('content').appendChild(data);

var anno = TEIPlugin(createTextAnnotator(document.getElementById('content')));
var anno = TEIPlugin(createTextAnnotator(document.getElementById('content')));

anno.loadAnnotations('annotations.json');
anno.loadAnnotations('annotations.json');

anno.on('createAnnotation', annotation => {
console.log('createAnnotation', annotation);
});
anno.on('createAnnotation', annotation => {
console.log('createAnnotation', annotation);
});

anno.on('updateAnnotation', (annotation, previous) => {
console.log('updateAnnotation', annotation);
});
anno.on('updateAnnotation', (annotation, previous) => {
console.log('updateAnnotation', annotation);
});

anno.on('deleteAnnotation', (annotation) => {
console.log('deleteAnnotation', annotation);
});
anno.on('deleteAnnotation', (annotation) => {
console.log('deleteAnnotation', annotation);
});

anno.on('selectionChanged', (annotations) => {
console.log('selectionChanged', annotations);
});
anno.on('selectionChanged', (annotations) => {
console.log('selectionChanged', annotations);
});

anno.on('viewportIntersect', (annotations) => {
console.log('viewport', annotations);
});
});
};
</script>
anno.on('viewportIntersect', (annotations) => {
console.log('viewport', annotations);
});
});
};
</script>
</body>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ export const createSpansRenderer = (
container: HTMLElement,
state: TextAnnotatorState<TextAnnotation, unknown>,
viewport: ViewportState
) => createBaseRenderer(container, state, viewport, createRenderer(container))
) => createBaseRenderer(container, state, viewport, createRenderer(container));

0 comments on commit ead4840

Please sign in to comment.