66 < link rel ="stylesheet " href ="CETEIcean.css ">
77 < script type ="module " src ="../src/index.ts "> </ script >
88 < style >
9- html , body {
10- background : # e2e2e2 ;
11- padding : 0 ;
12- margin : 0 ;
13- display : flex;
14- flex-direction : row;
15- justify-content : center;
16- }
17-
18- # content {
19- max-width : 800px ;
20- background-color : # fff ;
21- padding : 40px ;
22- border-style : solid;
23- border-color : # cfcfcf ;
24- border-width : 0 1px ;
25- position : relative;
26- }
27-
28- # content img {
29- max-width : 100% ;
30- }
31-
32- h1 {
33- margin : 0 ;
34- padding : 0 0 20px 0 ;
35- }
36-
37- p {
38- font-size : 17px ;
39- line-height : 160% ;
40- }
9+ * , * : before , * : after {
10+ box-sizing : border-box;
11+ }
12+
13+ html , body {
14+ background : # e2e2e2 ;
15+ padding : 0 ;
16+ margin : 0 ;
17+ display : flex;
18+ flex-direction : row;
19+ justify-content : center;
20+ }
21+
22+ # content {
23+ max-width : 800px ;
24+ background-color : # fff ;
25+ padding : 40px ;
26+ border-style : solid;
27+ border-color : # cfcfcf ;
28+ border-width : 0 1px ;
29+ position : relative;
30+ }
31+
32+ # content img {
33+ max-width : 100% ;
34+ }
35+
36+ h1 {
37+ margin : 0 ;
38+ padding : 0 0 20px 0 ;
39+ }
40+
41+ p {
42+ font-size : 17px ;
43+ line-height : 160% ;
44+ }
4145 </ style >
4246 </ head >
4347
4448 < body >
45- < div id ="content ">
46- </ div >
49+ < div id ="content ">
50+ </ div >
51+
52+ < script type ="module ">
53+ import CETEI from 'CETEIcean' ;
54+ import { createTextAnnotator } from '@recogito/text-annotator' ;
55+ import { TEIPlugin } from '../src/index.ts' ;
4756
48- < script type ="module ">
49- import CETEI from 'CETEIcean' ;
50- import { createTextAnnotator } from '@recogito/text-annotator' ;
51- import { TEIPlugin } from '../src/index.ts' ;
57+ import '@recogito/text-annotator/dist/text-annotator.css' ;
5258
53- import '@recogito/text-annotator/dist/text-annotator.css' ;
59+ window . onload = async function ( ) {
60+ var CETEIcean = new CETEI ( ) ;
5461
55- window . onload = async function ( ) {
56- var CETEIcean = new CETEI ( ) ;
62+ CETEIcean . getHTML5 ( 'macbeth.xml' , data => {
63+ document . getElementById ( 'content' ) . appendChild ( data ) ;
5764
58- CETEIcean . getHTML5 ( 'macbeth.xml' , data => {
59- document . getElementById ( 'content' ) . appendChild ( data ) ;
60-
61- var anno = TEIPlugin ( createTextAnnotator ( document . getElementById ( 'content' ) ) ) ;
65+ var anno = TEIPlugin ( createTextAnnotator ( document . getElementById ( 'content' ) ) ) ;
6266
63- anno . loadAnnotations ( 'annotations.json' ) ;
67+ anno . loadAnnotations ( 'annotations.json' ) ;
6468
65- anno . on ( 'createAnnotation' , annotation => {
66- console . log ( 'createAnnotation' , annotation ) ;
67- } ) ;
69+ anno . on ( 'createAnnotation' , annotation => {
70+ console . log ( 'createAnnotation' , annotation ) ;
71+ } ) ;
6872
69- anno . on ( 'updateAnnotation' , ( annotation , previous ) => {
70- console . log ( 'updateAnnotation' , annotation ) ;
71- } ) ;
73+ anno . on ( 'updateAnnotation' , ( annotation , previous ) => {
74+ console . log ( 'updateAnnotation' , annotation ) ;
75+ } ) ;
7276
73- anno . on ( 'deleteAnnotation' , ( annotation ) => {
74- console . log ( 'deleteAnnotation' , annotation ) ;
75- } ) ;
77+ anno . on ( 'deleteAnnotation' , ( annotation ) => {
78+ console . log ( 'deleteAnnotation' , annotation ) ;
79+ } ) ;
7680
77- anno . on ( 'selectionChanged' , ( annotations ) => {
78- console . log ( 'selectionChanged' , annotations ) ;
79- } ) ;
81+ anno . on ( 'selectionChanged' , ( annotations ) => {
82+ console . log ( 'selectionChanged' , annotations ) ;
83+ } ) ;
8084
81- anno . on ( 'viewportIntersect' , ( annotations ) => {
82- console . log ( 'viewport' , annotations ) ;
83- } ) ;
84- } ) ;
85- }
86- </ script >
85+ anno . on ( 'viewportIntersect' , ( annotations ) => {
86+ console . log ( 'viewport' , annotations ) ;
87+ } ) ;
88+ } ) ;
89+ } ;
90+ </ script >
8791 </ body >
88- </ html >
92+ </ html >
0 commit comments