CETEIcean 1.9.4 → 1.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/test/P5.css ADDED
@@ -0,0 +1,362 @@
1
+ tei-ab {
2
+ display:block;
3
+ }
4
+ tei-back {
5
+ display:block;
6
+ }
7
+ tei-body {
8
+ display: block;
9
+ }
10
+ tei-caption { display: block; }
11
+ tei-castitem {
12
+ display: list-item;
13
+ }
14
+ tei-castlist {
15
+ display: block;
16
+ }
17
+ tei-cell {
18
+ display: table-cell;
19
+ padding: 1px;
20
+ vertical-align: inherit;
21
+ }
22
+ tei-code {
23
+ font-family: monospace;
24
+ white-space:pre;
25
+ }
26
+ tei-colophon {
27
+ display: block;
28
+ }
29
+ tei-dateline {
30
+ display: block;
31
+ }
32
+ tei-del {
33
+ text-decoration: line-through;
34
+ }
35
+ tei-div, tei-div1, tei-div2, tei-div3, tei-div4, tei-div5, tei-div6, tei-div7, tei-divgen {
36
+ display:block;
37
+ margin:1em;
38
+ }
39
+ teieg-egxml {
40
+ display: block;
41
+ margin-block-start: 1em;
42
+ margin-block-end: 1em;
43
+ font-family: monospace;
44
+ white-space: pre;
45
+ }
46
+ tei-emph {
47
+ font-style: italic;
48
+ }
49
+ tei-figure {
50
+ display: block;
51
+ }
52
+ tei-floatingtext {
53
+ display: block;
54
+ }
55
+ tei-head {
56
+ display: block;
57
+ }
58
+ tei-hi[rend~="bold"] {
59
+ font-weight: bold;
60
+ }
61
+ tei-hi[rend~="italic"] {
62
+ font-style: italic;
63
+ }
64
+ tei-hi[rend~="underline"] {
65
+ text-decoration: underline;
66
+ }
67
+ tei-item {
68
+ display:list-item;
69
+ }
70
+ tei-l {
71
+ display:block;
72
+ }
73
+ tei-lg {
74
+ display:block;
75
+ }
76
+ tei-list {
77
+ display: block;
78
+ }
79
+ tei-list[rend="numbered"] {
80
+ list-style-type: decimal;
81
+ }
82
+ tei-list[rend="bulleted"] {
83
+ list-style-type: disc;
84
+ }
85
+ tei-listannotation {
86
+ display: block;
87
+ }
88
+ tei-listapp {
89
+ display: block;
90
+ }
91
+ tei-listapp > tei-app {
92
+ display: list-item;
93
+ }
94
+ tei-listbibl {
95
+ display: block;
96
+ }
97
+ tei-listbibl > tei-bibl {
98
+ display: list-item;
99
+ }
100
+ tei-listchange {
101
+ display: block;
102
+ }
103
+
104
+ tei-listevent {
105
+ display: block;
106
+ }
107
+ tei-listnym {
108
+ display: block;
109
+ }
110
+ tei-listobject {
111
+ display: block;
112
+ }
113
+ tei-listorg {
114
+ display: block;
115
+ }
116
+ tei-listperson {
117
+ display: block;
118
+ }
119
+ tei-listplace {
120
+ display: block;
121
+ }
122
+ tei-listref {
123
+ display: block;
124
+ }
125
+ tei-listwit {
126
+ display: block;
127
+ }
128
+
129
+ tei-p {
130
+ display: block;
131
+ }
132
+ tei-param { /* placeholder */ }
133
+ tei-paramlist { /* placeholder */ }
134
+ tei-paramspec { /* placeholder */ }
135
+ tei-particdesc { /* placeholder */ }
136
+ tei-path { /* placeholder */ }
137
+ tei-pause { /* placeholder */ }
138
+ tei-pb { /* placeholder */ }
139
+ tei-pc { /* placeholder */ }
140
+ tei-per { /* placeholder */ }
141
+ tei-performance { /* placeholder */ }
142
+ tei-persname { /* placeholder */ }
143
+ tei-person { /* placeholder */ }
144
+ tei-persona { /* placeholder */ }
145
+ tei-persongrp { /* placeholder */ }
146
+ tei-phr { /* placeholder */ }
147
+ tei-physdesc { /* placeholder */ }
148
+ tei-place { /* placeholder */ }
149
+ tei-placename { /* placeholder */ }
150
+ tei-population { /* placeholder */ }
151
+ tei-pos { /* placeholder */ }
152
+ tei-postbox { /* placeholder */ }
153
+ tei-postcode { /* placeholder */ }
154
+ tei-postscript { /* placeholder */ }
155
+ tei-precision { /* placeholder */ }
156
+ tei-pref { /* placeholder */ }
157
+ tei-prefixdef { /* placeholder */ }
158
+ tei-preparedness { /* placeholder */ }
159
+ tei-principal { /* placeholder */ }
160
+ tei-profiledesc { /* placeholder */ }
161
+ tei-projectdesc { /* placeholder */ }
162
+ tei-prologue { /* placeholder */ }
163
+ tei-pron { /* placeholder */ }
164
+ tei-provenance { /* placeholder */ }
165
+ tei-ptr { /* placeholder */ }
166
+ tei-publicationstmt { /* placeholder */ }
167
+ tei-publisher { /* placeholder */ }
168
+ tei-pubplace { /* placeholder */ }
169
+ tei-punctuation { /* placeholder */ }
170
+ tei-purpose { /* placeholder */ }
171
+ tei-q { /* placeholder */ }
172
+ tei-quotation { /* placeholder */ }
173
+ tei-quote { /* placeholder */ }
174
+ tei-rdg {
175
+ display: none;
176
+ }
177
+ tei-rdggrp { /* placeholder */ }
178
+ tei-re { /* placeholder */ }
179
+ tei-recordhist { /* placeholder */ }
180
+ tei-recording { /* placeholder */ }
181
+ tei-recordingstmt { /* placeholder */ }
182
+ tei-redo { /* placeholder */ }
183
+ tei-ref { /* placeholder */ }
184
+ tei-refsdecl { /* placeholder */ }
185
+ tei-refstate { /* placeholder */ }
186
+ tei-reg { /* placeholder */ }
187
+ tei-region { /* placeholder */ }
188
+ tei-relateditem { /* placeholder */ }
189
+ tei-relation { /* placeholder */ }
190
+ tei-remarks { /* placeholder */ }
191
+ tei-rendition { /* placeholder */ }
192
+ tei-repository { /* placeholder */ }
193
+ tei-residence { /* placeholder */ }
194
+ tei-resp { /* placeholder */ }
195
+ tei-respons { /* placeholder */ }
196
+ tei-respstmt { /* placeholder */ }
197
+ tei-restore { /* placeholder */ }
198
+ tei-retrace { /* placeholder */ }
199
+ tei-revisiondesc { /* placeholder */ }
200
+ tei-rhyme { /* placeholder */ }
201
+ tei-role { /* placeholder */ }
202
+ tei-roledesc { /* placeholder */ }
203
+ tei-rolename { /* placeholder */ }
204
+ tei-root { /* placeholder */ }
205
+ tei-row {
206
+ display: table-row;
207
+ border-color: inherit;
208
+ vertical-align: inherit;
209
+ }
210
+ tei-rs { /* placeholder */ }
211
+ tei-rubric { /* placeholder */ }
212
+ tei-s { /* placeholder */ }
213
+ tei-said { /* placeholder */ }
214
+ tei-salute { /* placeholder */ }
215
+ tei-samplingdecl { /* placeholder */ }
216
+ tei-schemaref { /* placeholder */ }
217
+ tei-schemaspec { /* placeholder */ }
218
+ tei-scriptdesc { /* placeholder */ }
219
+ tei-scriptnote { /* placeholder */ }
220
+ tei-scriptstmt { /* placeholder */ }
221
+ tei-seal { /* placeholder */ }
222
+ tei-sealdesc { /* placeholder */ }
223
+ tei-secfol { /* placeholder */ }
224
+ tei-secl { /* placeholder */ }
225
+ tei-seg { /* placeholder */ }
226
+ tei-segmentation { /* placeholder */ }
227
+ tei-sense { /* placeholder */ }
228
+ tei-sequence { /* placeholder */ }
229
+ tei-series { /* placeholder */ }
230
+ tei-seriesstmt { /* placeholder */ }
231
+ tei-set { /* placeholder */ }
232
+ tei-setting { /* placeholder */ }
233
+ tei-settingdesc { /* placeholder */ }
234
+ tei-settlement { /* placeholder */ }
235
+ tei-sex { /* placeholder */ }
236
+ tei-shift { /* placeholder */ }
237
+ tei-sic { /* placeholder */ }
238
+ tei-signatures { /* placeholder */ }
239
+ tei-signed { /* placeholder */ }
240
+ tei-socalled { /* placeholder */ }
241
+ tei-socecstatus { /* placeholder */ }
242
+ tei-sound { /* placeholder */ }
243
+ tei-source { /* placeholder */ }
244
+ tei-sourcedesc { /* placeholder */ }
245
+ tei-sourcedoc { /* placeholder */ }
246
+ tei-sp { /* placeholder */ }
247
+ tei-space { /* placeholder */ }
248
+ tei-span { /* placeholder */ }
249
+ tei-spangrp { /* placeholder */ }
250
+ tei-speaker { /* placeholder */ }
251
+ tei-specdesc { /* placeholder */ }
252
+ tei-specgrp { /* placeholder */ }
253
+ tei-specgrpref { /* placeholder */ }
254
+ tei-speclist { /* placeholder */ }
255
+ tei-spgrp { /* placeholder */ }
256
+ tei-sponsor { /* placeholder */ }
257
+ tei-stage { /* placeholder */ }
258
+ tei-stamp { /* placeholder */ }
259
+ tei-standoff {
260
+ display: none;
261
+ }
262
+ tei-state { /* placeholder */ }
263
+ tei-stdvals { /* placeholder */ }
264
+ tei-street { /* placeholder */ }
265
+ tei-stress { /* placeholder */ }
266
+ tei-string { /* placeholder */ }
267
+ tei-styledefdecl { /* placeholder */ }
268
+ tei-subc { /* placeholder */ }
269
+ tei-subst { /* placeholder */ }
270
+ tei-substjoin { /* placeholder */ }
271
+ tei-summary { /* placeholder */ }
272
+ tei-superentry { /* placeholder */ }
273
+ tei-supplied { /* placeholder */ }
274
+ tei-support { /* placeholder */ }
275
+ tei-supportdesc { /* placeholder */ }
276
+ tei-surface { /* placeholder */ }
277
+ tei-surfacegrp { /* placeholder */ }
278
+ tei-surname { /* placeholder */ }
279
+ tei-surplus { /* placeholder */ }
280
+ tei-surrogates { /* placeholder */ }
281
+ tei-syll { /* placeholder */ }
282
+ tei-symbol { /* placeholder */ }
283
+ tei-table {
284
+ display: table;
285
+ box-sizing: border-box;
286
+ border-spacing: 2px;
287
+ border-collapse: separate;
288
+ text-indent: initial;
289
+ }
290
+ tei-tag { /* placeholder */ }
291
+ tei-tagsdecl { /* placeholder */ }
292
+ tei-tagusage { /* placeholder */ }
293
+ tei-taxonomy { /* placeholder */ }
294
+ tei-tech { /* placeholder */ }
295
+ tei-tei { /* placeholder */ }
296
+ tei-teicorpus { /* placeholder */ }
297
+ tei-teiheader {
298
+ display: none;
299
+ }
300
+ tei-term { /* placeholder */ }
301
+ tei-terrain { /* placeholder */ }
302
+ tei-text { /* placeholder */ }
303
+ tei-textclass { /* placeholder */ }
304
+ tei-textdesc { /* placeholder */ }
305
+ tei-textlang { /* placeholder */ }
306
+ tei-textnode { /* placeholder */ }
307
+ tei-then { /* placeholder */ }
308
+ tei-time { /* placeholder */ }
309
+ tei-timeline { /* placeholder */ }
310
+ tei-title { /* placeholder */ }
311
+ tei-titlepage { /* placeholder */ }
312
+ tei-titlepart { /* placeholder */ }
313
+ tei-titlestmt { /* placeholder */ }
314
+ tei-tns { /* placeholder */ }
315
+ tei-trailer { /* placeholder */ }
316
+ tei-trait { /* placeholder */ }
317
+ tei-transcriptiondesc { /* placeholder */ }
318
+ tei-transpose { /* placeholder */ }
319
+ tei-tree { /* placeholder */ }
320
+ tei-triangle { /* placeholder */ }
321
+ tei-typedesc { /* placeholder */ }
322
+ tei-typenote { /* placeholder */ }
323
+ tei-u { /* placeholder */ }
324
+ tei-unclear { /* placeholder */ }
325
+ tei-undo { /* placeholder */ }
326
+ tei-unicodename { /* placeholder */ }
327
+ tei-unicodeprop { /* placeholder */ }
328
+ tei-unihanprop { /* placeholder */ }
329
+ tei-unit { /* placeholder */ }
330
+ tei-unitdecl { /* placeholder */ }
331
+ tei-unitdef { /* placeholder */ }
332
+ tei-usg { /* placeholder */ }
333
+ tei-val { /* placeholder */ }
334
+ tei-valdesc { /* placeholder */ }
335
+ tei-valitem { /* placeholder */ }
336
+ tei-vallist { /* placeholder */ }
337
+ tei-valt { /* placeholder */ }
338
+ tei-value { /* placeholder */ }
339
+ tei-variantencoding { /* placeholder */ }
340
+ tei-vcoll { /* placeholder */ }
341
+ tei-vdefault { /* placeholder */ }
342
+ tei-view { /* placeholder */ }
343
+ tei-vlabel { /* placeholder */ }
344
+ tei-vmerge { /* placeholder */ }
345
+ tei-vnot { /* placeholder */ }
346
+ tei-vocal { /* placeholder */ }
347
+ tei-vrange { /* placeholder */ }
348
+ tei-w { /* placeholder */ }
349
+ tei-watermark { /* placeholder */ }
350
+ tei-when { /* placeholder */ }
351
+ tei-width { /* placeholder */ }
352
+ tei-wit { /* placeholder */ }
353
+ tei-witdetail { /* placeholder */ }
354
+ tei-witend { /* placeholder */ }
355
+ tei-witness { /* placeholder */ }
356
+ tei-witstart { /* placeholder */ }
357
+ tei-writing { /* placeholder */ }
358
+ tei-xenodata {
359
+ display: none;
360
+ }
361
+ tei-xr { /* placeholder */ }
362
+ tei-zone { /* placeholder */ }
@@ -1,7 +1,8 @@
1
- <html>
1
+ <html lang="en">
2
2
  <head>
3
3
  <meta charset="utf-8">
4
- <link rel="stylesheet" href="CETEIcean.css" charset="utf-8">
4
+ <link rel="stylesheet" href="CETEIcean.css">
5
+ <title>CETEIcean Add Behaviors Test</title>
5
6
  </head>
6
7
  <body>
7
8
  <div id="TEI">
@@ -0,0 +1,112 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Document</title>
7
+ <script src="../dist/CETEI.js"></script>
8
+ <style>
9
+ tei-teiheader * {
10
+ white-space: pre;
11
+ }
12
+ [lang=ar] *{
13
+ direction: rtl;
14
+ font-size: larger;
15
+ text-align: right;
16
+ }
17
+ tei-div, tei-head, tei-p {
18
+ display: block;
19
+ }
20
+ </style>
21
+ </head>
22
+ <body>
23
+ <script>
24
+ const c = new CETEI({omitDefaultBehaviors: true});
25
+ const behaviors = {
26
+ "namespaces": {
27
+ "tei": "http://www.tei-c.org/ns/1.0",
28
+ "teieg": "http://www.tei-c.org/ns/Examples"
29
+ },
30
+ tei: {
31
+ "div": function(elt) {
32
+ elt.setAttribute('contenteditable', 'true');
33
+ },
34
+ },
35
+ "functions": {
36
+ "tag": function(elt, type, name) {
37
+ const c = document.createElement('canvas');
38
+ const ctx = c.getContext('2d');
39
+ ctx.font='16px Courier';
40
+ const start = name ? name : `${elt.getAttribute('data-origname')} ${this.attributes(elt)}`.trim();
41
+ const end = name ? name : elt.getAttribute('data-origname');
42
+ ctx.textBaseline = 'middle';
43
+ const sm = ctx.measureText(start);
44
+ const h = 25;
45
+ if (type == 'start') {
46
+ const w = Math.ceil(sm.width + 10);
47
+ c.setAttribute('width', w);
48
+ c.setAttribute('height', h);
49
+ ctx.beginPath();
50
+ ctx.fillStyle = 'silver';
51
+ ctx.moveTo(3, Math.ceil(h/2));
52
+ ctx.lineTo(8, 1);
53
+ ctx.lineTo(8, h-1);
54
+ ctx.fill();
55
+ ctx.fillRect(8, 1, w-8, h - 2);
56
+ ctx.fillStyle = 'black';
57
+ ctx.font='16px Courier';
58
+ ctx.fillText(start,9,18);
59
+ c.addEventListener('click', function() {
60
+ alert('You clicked on ' + elt.getAttribute('data-origname'));
61
+ });
62
+ }
63
+ if (type == 'end') {
64
+ const m = ctx.measureText(end);
65
+ const w = Math.ceil(m.width + 8);
66
+ c.setAttribute('width', w);
67
+ c.setAttribute('height', h);
68
+ ctx.beginPath();
69
+ ctx.fillStyle = 'silver';
70
+ ctx.fillRect(0, 1, w-8, h - 2);
71
+ ctx.moveTo(w-3, Math.ceil(h/2));
72
+ ctx.lineTo(w-8, 1);
73
+ ctx.lineTo(w-8, h-1);
74
+ ctx.fill();
75
+ ctx.fillStyle = 'black';
76
+ ctx.font='16px Courier';
77
+ //ctx.textBaseline = 'middle';
78
+ ctx.fillText(end,2,18);
79
+ }
80
+ return c;
81
+ },
82
+ "attributes": (elt) => {
83
+ let result = ' ';
84
+ if (elt.hasAttribute('data-origatts')) {
85
+ const attrs = elt.getAttribute('data-origatts').split(' ');
86
+ for (const name of attrs) {
87
+ if (name == 'xmlns') {
88
+ result += `${name}="${elt.getAttribute('data-xmlns')}" `;
89
+ } else {
90
+ result += `${name}="${elt.getAttribute(name.toLowerCase())}" `;
91
+ }
92
+
93
+ }
94
+ }
95
+ return result.trim();
96
+ }
97
+ }
98
+ };
99
+ c.addBehaviors(behaviors);
100
+ c.getHTML5("1259.xml",
101
+ function(data) {
102
+ document.querySelector("div#TEI").appendChild(data);
103
+ },
104
+ function(newElt, elt) {
105
+ newElt.prepend(c.utilities.tag(newElt, 'start'));
106
+ newElt.append(c.utilities.tag(newElt, 'end'));
107
+ }
108
+ );
109
+ </script>
110
+ <div id="TEI"></div>
111
+ </body>
112
+ </html>